Le 23.10.2013 16:24, Mário Barbosa a écrit :
On 10/23/2013 02:48 PM, berenger.mo...@neutralite.org wrote:

I already did something along the lines of...

cd /var/cache/apt/archives
ls -1 *.deb | xargs sudo dpkg -Gi

But this will install everything you installed if you never cleaned that
dir... you may find useful this command in the future:
$ aptitude search '~i'

The ~i means all installed packages. The generated list will include all automatically installed packages so it's not perfect for your needs, but I do not remember the exact syntax to exclude them. Aptitude's manual
should help here.

Thank you for this tip. Added it to my "toolbox" (my own private
command cheat sheets).


[...]

Upon further investigation, here's what was done:

sudo chown -R <someuser>:<somegroup> /

wow... he really did that on /. You could add to the lesson to never use
recursive changes on root directory I guess...


In his defense, his only mistake was running a post-receive hook out
of its context (different current dir, different user). What is
written in that hook/script is my responsibility.

Rhetoric:
* Should he have done it? No.
* Should I have enforced proper working dir? Probably yes.

He is not a sysadmin, so maybe I should have anticipated some of
these "wildcard" type of actions...

Checking all external data is always a good idea in programming. Users (humans or external softwares) can do really strange things sometimes.

You could try to not reinstall the whole system with installer, but
simply use aptitude (with the ncurse interface) to purge (and not
remove, so that configuration files are removed and reinstalled) all
packages. Then, installing them back, if you know what you need. Given that you still have the files in /var/cache/apt/archives it should not involve any downloading, and you will skip the installer's questions. Between the purge and reinstalling, you could probably change back every
ownership and perms to root in / (except /home of course) and remove
users and groups which could have been installed by packages.

It is simply a solution which might be faster than reinstalling. Or not,
it depends on what you have installed so far.

The idea of purging config files "scares" me quite a bit. Are edited
files saved somewhere (like rpm does with the ".rpmsave" extensions)?
Maybe then I'm trading one type of problem for another (the new one
being "validating that every config is set as needed")...

No, they are not saved, you have to do that manually (but it only affects those in /etc, not userland files).
Exactly as if you were trying to reinstall from scratch, in fact.

Berenger, thank you for your help. Please, waste no more of your time
on this.

Not a real loss of time.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/ce16e902ab687b3d36743e111a349...@neutralite.org

Reply via email to