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

Jim Galarowicz jeg at krellinst.org
Fri Apr 25 14:09:45 UTC 2008


Hi Panu, all,

Thanks much for this information!!

I can only get access to my system via booting in fc8 rescue
install. The rescue mounts my system as /mnt/sysimage.
Then I do a chroot /mnt/sysimage.  After that I can
use your very helpful command to get the damaged packages.

But yum was one of the packages that was damaged and is gone
from the system.

Is there a way to update my system while using the recovery
system yum/rpm?

Thanks a lot for your help!

Jim G



Panu Matilainen wrote:
> 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 
> %post/%postun.
> 
>> 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 work.
> 
> 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