Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

EXT2 boot drive got corrupted on a small debian box I'm running, nothing critical. An fsck took care of the fs level damage. The machine boots now, but there's apparently lots of little lib files and other stuff that got messed up when the drive messed up.

Now, I can certainly restore from backup (yes, I have one), but I was wondering if debian will set up to do something like

# apt-get install --reinstall [everything]

Off the top of my head, I can bash something like (idea code, not good code, I know)

# dpkg -l | awk [whatever] | apt-get install --reinstall {}

but if apt-get already has that option somewhere, why reinvent the wheel? Although googling doesn't bring up anything obvious.

The other question is whether doing a reinstall everything may actually be a bad idea for some reason?

Thoughts?

share|improve this question
    
I also suggest using the EXT3 filesystem over EXT2 as it helps out in the corruption area. It's easy to upgrade without having to recopy/remake everything. –  mdpc Jan 19 '12 at 22:50

1 Answer 1

Not with apt-get but:

aptitude reinstall '~i'

means "reinstall all installed packages".

However this will NOT replace missing or altered conffiles or other configuration files if they are missing, since debian assumes that if a configuration file is missing or altered, it is for a good reason. There are various ways to get back configuration files, but it unfortunately depends on how the package missing configuration files is setup. If there is a possibility that configuration files are missing or corrupt, you should probably just reinstall from install media.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.