How to restore /lib/libc.so.6?

0

I occasionally deleted my /lib/libc.so.6.

By using LD_PRELOAD I successfully made a link of my /lib/libc-2.12.1.so file in my home folder and now most of the command works (cp, ln, etc...). But I still can not make a new link in /lib/ because sudo still doesn't work

sudo: error while loading shared libraries: libc.so.6: cannot open shared object 
file: No such file or directory

Anyone can help me out?

zhanwu

Posted 2011-04-05T21:26:13.470

Reputation: 853

Answers

1

I suggest you bypass sudo and reboot into a LiveCD. From it, you should be able to copy the file on your main hard disk to its proper location.

If you have no LiveCD access, you could attempt to use su and login directly as your root user. This may break as sudo has, so this is a bit iffy.

Also, you could attempt to reboot into single user mode (by appending 3 to the kernel's boot options) and login as root directly.

new123456

Posted 2011-04-05T21:26:13.470

Reputation: 3 707

yeah, that solved my problem – zhanwu – 2011-04-06T15:45:30.577

0

Sudo may not work, but what about su?

$ su
Enter root's password:
# <now you are root>

This of course depends on you having set up a root password at some point in the past and you remembering what it is now ;)

Majenko

Posted 2011-04-05T21:26:13.470

Reputation: 29 007