Re: [Rpm-maint] rpm version on fc8 removed my /usr/include and /usr/bin
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 - ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] rpm version on fc8 removed my /usr/include and /usr/bin
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 - ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] rpm version on fc8 removed my /usr/include and /usr/bin
On Fri, 25 Apr 2008, Jim Galarowicz wrote: Hi Panu, all, Thanks much for this information!! I can only get access to my system via booting in fc8 rescue install. That bad... ouch again :-/ 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? Oh, the rescue image has yum these days? (Been a while since I've last used one :) In that case, don't chroot to /mnt/sysimage but use --installroot=/mnt/sysimage option for yum, something like this should work: # yum --installroot=/mnt/sysimage reinstall $(cat /mnt/sysimage/tmp/damaged-pkgs.txt) Except... there's probably an extra roadblock: if memory serves, reinstall wasn't implemented in the initial F8 yum version, so there are some extra hoops to jump through. Try the following from the rescue image, without chrooting: # rpm -e --justdb --root /mnt/sysimage yum # yum --installroot=/mnt/sysimage install yum With a little bit of luck, you should be able to chroot to /mnt/sysimage and have a working, new yum there that can do reinstall as described earlier. Or at least a working yum in the chroot so you can update to a newer one that can finally do the reinstall. - Panu - ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] rpm version on fc8 removed my /usr/include and /usr/bin
On Fri, 25 Apr 2008, Jim Galarowicz wrote: Hi Panu, Your comment about yum on the rescue disk is valid. It's not there. Bummer! Right, in that case just grab the latest F8 yum package from a Fedora mirror and install with --force, that ought to give a working yum inside the chroot environment (as yum doesn't rely on anything else in /usr/bin/ AFAIK, certainly not /usr/include/) - Panu - ___ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint