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?

2 Answers 2

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.

1
  • yeah, that solved my problem
    – zhanwu
    Apr 6, 2011 at 15:45
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 ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .