[Rpm-maint] rpm version on fc8 removed my /usr/include and /usr/bin

Panu Matilainen pmatilai at redhat.com
Fri Apr 25 07:47:56 UTC 2008

On Thu, 24 Apr 2008, Jim Galarowicz wrote:
> Hi!
> I was removing a couple of packages on my fc8 laptop and
> the rpm command:
> rpm --erase libdwarf-020801-1 libdwarf-072705-1
> seemed to hang.
> I went into another window and saw that /usr/include was
> gone and most of /usr/bin was also removed.

Ouch. There aren't "erases half your disk" bugs in rpm that I'm aware of, 
I wonder if the libdwarf packages do something very nasty in their 

> I'm trying to recover from this without having to completely
> rebuild.  Looks like my kernel is intact but it won't completely
> come up because a lot of the /usr/bin commands are gone.
> Anyone have any advice on this?
> Do I have any chance of not starting from scratch?

If only /usr/include and (parts of) /usr/bin are gone, you should be able 
to use rpm to verify which packages have been damaged and then reinstall 
just those. Something like this, assuming the necessary tools like awk, 
xargs, yum and friends are intact, if not then manually reinstalling them 
is probably worth the trouble they save:

This'll get you a list of packages with missing files and directories:
# rpm -Va --nodeps --nomd5 2> /dev/null|grep ^missing|awk '{print $NF}' | 
xargs rpm -qf > /tmp/damaged-pkgs.txt

Now you can feed that to yum:
# yum reinstall $(cat /tmp/damaged-pkgs.txt)

Yum is pretty picky here and won't do anything at all if the list 
containst packages that aren't available in enabled repositories, some 
manual editing of the package list might be needed. Now, of course you can 
do the reinstall step manually with just rpm but it's a whole lot more 

With the major part (hopefully) of missing bits have been reinstalled, run 
an entire verify on the system and watch out for suspicious bits like 
incorrect permissions and md5 mismatches, then manually reinstall any 
remaining parts as necessary:
# rpm -Va

 	- Panu -

More information about the Rpm-maint mailing list