LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   /lib/libc.so.6 accidently removed (http://www.linuxquestions.org/questions/linux-software-2/lib-libc-so-6-accidently-removed-766813/)

raghupv30 11-04-2009 09:24 AM

/lib/libc.so.6 accidently removed
 
Hi,
I accidently removed /lib/libc.so.6 running Red Hat 5 Enterprise edition.
I think this /lib/libc.so.6 was a symbolic link to /usr/lib/libc.so

I am unable to execute any of the commands
[root@netappsim lib]# ls -ltr libc.so.6
ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

Please help me as how to revert the sym link /lib/libc.so.6

Thanks,
Raghu

knudfl 11-04-2009 10:09 AM

Welcome to LQ.

Code:

ls -l /usr/lib/libc.*
-rw-r--r-- 1 root root 2811674 Jan 21  2009 /usr/lib/libc.a
-rw-r--r-- 1 root root    238 Jan 21  2009 /usr/lib/libc.so

 ls -l /lib/libc.*
lrwxrwxrwx 1 root root 11 Aug  7 18:58 /lib/libc.so.6 -> libc-2.5.so

If you can use the command line :
1) cd /lib/
2) su
3) ln -s libc-2.5.so libc.so.6

Else you will have to shut down the computer.
And use a live Linux cd to get to a command line,
and ' cd ' into /lib/ , to do the ' ln ' command.
.....

pwc101 11-04-2009 10:15 AM

If the above doesn't work, before restrting the box, try:
Code:

/lib/ld-linux.so.2 --library-path /lib /bin/ln -s /lib/libc-2.5.so /lib/libc.so.6
It's worked in the past in a similar situation with the error messages you got.

raghupv30 11-05-2009 03:47 AM

Thanks
 
Thanks for all the replies.
The ln command was also displaying the same error messages since ln seems to be using/linked to libc.so.6

I had installed Redhat Linux as a Guest OS using Vmware running Windows as host.
Fortunately I had the recent backup of the entire the virtual machine and so was able to revert to the earlier state.

Unfortunately, i didnt try executing /lib/ld-linux.so.2 --library-path /lib /bin/ln -s /lib/libc-2.5.so /lib/libc.so.6
as I had already restarted the system.

yanniss 02-14-2012 07:20 AM

I was surprised I couldn't find an answer to the "removed libc symlink" problem other than "use a live CD" (which I couldn't do, as I did this on a server on the other side of the planet). I resolved the issue by using a statically linked version of "ln" that was already in the server's /sbin.

E.g., this restored it for my configuration:
/sbin/sln /lib64/libc-2.5.so /lib64/libc.so.6

The statically linked ln doesn't need the dynamic libc.

lwen 04-07-2014 09:27 PM

It works, thank you very much
 
Quote:

Originally Posted by yanniss (Post 4602019)
I was surprised I couldn't find an answer to the "removed libc symlink" problem other than "use a live CD" (which I couldn't do, as I did this on a server on the other side of the planet). I resolved the issue by using a statically linked version of "ln" that was already in the server's /sbin.

E.g., this restored it for my configuration:
/sbin/sln /lib64/libc-2.5.so /lib64/libc.so.6

The statically linked ln doesn't need the dynamic libc.

Thank you so much for this easy solution for i am using someone else's VMware
and does not have a Live CD to recover the missing libc.so.6. I was really
sweating when i found `ls` was not working. Your post really saves my day,
thanks again.


All times are GMT -5. The time now is 11:49 AM.