Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Assume, I have a system with all the packages installed, which I want, and all configuration files set up as desired. However, the files on the file system could have become corrupted or missing due to some mistake in the past or hardware error. The corrupted files would be replace if the package in question was reinstalled. Such a situation is described elsewhere

Can I safely run

aptitude reinstall ?installed

to get a fresh version of my system?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

A good way to deal with file corruption is to use `debsums' (see these instructions, and also this great answer), though they're starting with a non-booting system) which will discover which files are corrupted; then you can reinstall just those packages.

Your reinstall command is safe, but it's not guaranteed to fix everything that might have been caused by a hardware error.

You might also like to force a fsck or run a badblocks scan. You can do both of those from inside the disk utility.

share|improve this answer
1  
The answer provided by enzotib in Is there a Ubuntu sanity check also gives good instructions for debsums. –  Jan Aug 19 '11 at 7:58
add comment

I would not suggest to do so, because it could be a very long and for the most part un-useful operation. Moreover configuration files and personal configuration files are not involved in the simple reinstall, and the problem could be just there.

It is better to try to determine which packages have problems and reinstall only these packages.

share|improve this answer
add comment

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.