Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
yeah, that solved my problem –  zhanwu Apr 6 '11 at 15:45

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 ;)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.