Re: unbelievably stupid mistake - i broke /usr/lib need help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alastair McKinley wrote:
Sam Varshavchik wrote:

You can try installing FC4 on another machine, and copy the librpm .so file from there. You will not be able to do anything, NOTHING, not rpm, not yum, until this is fixed.

But, that's just the beginning.  What you basically have to do:

1) Run "rpm -q -a -l", which is going to spit out every file installed by every package you have supposedly installed. 2) If you're fairly certain that you only broke /usr/lib, grep the file list for "/usr/lib", then hack up a short script to check if each file still exist, and spit out the exact list of missing files.

3)  Use "rpm -q -f" to find out which packages they belong to.

4) Make sure you have these RPMs available, and "rpm -e --force" each one, followed by "rpm -i nodeps" to reinstall it.

5)  Finally run ldconfig.

That should fix this, but it's probably easier to just chalk it up to experience, and reinstall. If it's of any consolation, at least you didn't wipe /lib, with the standard C runtime library. That would've been a double-boner (actually, at least a quadruple-boner, on the Richter scale),



Thanks for the advice Sam. I managed to get the rpms downloaded on to my desktop, extracted them and I kept on replacing dependencies until rpm came alive again.
I'll try something like what you have suggested soon.


I have a sneaky suspicion that you were trying to either install or uninstall some external software package manually, without building RPMs. That's the only reason I can think for screwing around in /usr/lib, as root. And this is just one of the reasons why you should never install various warez directly, manually, and you should always use rpm. And if the warez doesn't come with a suitable rpm, then build one yourself. The only reason for su-ing to root is to "rpm -i" the freshly-built RPMs.



I feel like I should try and explain myself for this one! I was playing around with installing linux on my ipaq. Its a h2200 and the linux port is nearly finished but not quite there. I had the root file system on an SD card mounted at /media/usbdisk1

I needed to wipe the partition and install a new rootfs. In order to delete files owned by root, I needed to be root. Something refused to delete in /usr/lib (on my SD card, i.e /media/usbdisk1/usr/lib).

So I'm at /media/usbdisk1 and I meant to type cd ./usr/lib, but I actually typed cd /usr/lib.

And then the final mistake: rm -rf ./*

I wondered for a second why it was taking so long as its a very small root file system. Then I realised, I hit crtl-c but I was way too late.

I think I've learned my lesson.


Alastair


The first time I used "su -" I ended up wiping out my /root/* directory. I have done it once since as well. Since I really don't use root anymore, it was no loss.

It is so easy to be distracted by someone coming into the office or a kid grabbing onto your leg. :) Or it being 3:30 in the morning when you have to get up at 5:30.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux