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

Re: I have hosed my shared libs!



> Well, now I've done it. I was trying to replace libc.so.6 in /lib/ with the
> one in /initrd (they seemed the same to me). I chose to use cp to do that.
> heh. Now nothing works. Not cp, not ls, not the most simple of commands.
> What do I do now? I guess I accidentally got rid of something _verrry_
> important. How do I get it back?

First off, congratulations. That's the beauty of Linux: you get to do some
very exciting (if stupid) things, learn how to recover from them and live
to tell it. I'm only being mildly sarcastic here. 

OK, what you need to do is

- find a Debian package with the right version of libc in it, unpack that
file and put it someplace where you can access it from your ramdisk booted
system.

- boot the ramdisk, and replace the libc on disk with the one you unpacked
from the package.

- if possible run ldconfig on the disk system to fix the erroneous
ld.so.cache information. You might need to remove ld.so.cache if nothing
else helps. 

- reboot. 

For this to work out, you'll need to know the version of libc that
originaly was installed on your system. If you can't find that version
number anywhere, poke around in /var/lib/dpkg/ and its subdirectories,
there's a lengthy list of all installed packages somewhere in that area. 

Another thing that might be helpful: Debian packages are just ar format
archives. The data.tar file in that archive contains all the files that
are installed by the package, in (you guessed it) tar format. ar x
extracts stuff from the archive, ar t lists the contents.

For the future, please remember to never, ever muck with libc,
libreadline, bash or a number of other critical system components unless
you are absolutey sure you know what you are doing. If in doubt what a
strange error message means, ask.

	Michael


Reply to: