After a power outage, my CentOS server began having a problem where many of the system commands became corrupted. As a result I have been getting messages saying "cannot execute binary file" on critical commands such as rm or mv. Using the linux rescue cd I managed to replace a few of the files to get me back to a mostly working state, but I am still running into issues with lesser-critical commands such as sed or tar. Rather than find and replace each file that may be broken individually, I would like to just go ahead and completely replace or repair these system commands to their default state. I have tried running the upgrade process from my CentOS disc, but this only caused a problem with my initrd file and did not correct any issue with my system commands. Can anyone suggest where I can find a package to reinstall these files without having to reinstall CentOS?
As @Ency suggests:
will show you everything that's changed.
However, I suggest installing "yum-verify" or if it's not already installed and then using something like:
This is very similar to the "rpm --verify", but you can restrict it to certain directories and it defaults to not showing you configuration file changes.
The output doesn't really tell you what package something is from, so you'd need to use:
or
to see what package that file belongs to
Then you could use:
to reinstall the RPM even if it's the same version.
However, I recommend backing up the files you need (
/home
,/etc
, `/var/, etc.) and reinstalling everything from scratch. From what you described I suspect you won't find all the problems hiding on the system.