LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-04-2009, 09:24 AM   #1
raghupv30
LQ Newbie
 
Registered: Jul 2008
Posts: 3

Rep: Reputation: 0
/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
 
Old 11-04-2009, 10:09 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.
.....
 
Old 11-04-2009, 10:15 AM   #3
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
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.
 
Old 11-05-2009, 03:47 AM   #4
raghupv30
LQ Newbie
 
Registered: Jul 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Smile 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.
 
Old 02-14-2012, 07:20 AM   #5
yanniss
LQ Newbie
 
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 04-07-2014, 09:27 PM   #6
lwen
LQ Newbie
 
Registered: Feb 2009
Posts: 1

Rep: Reputation: 0
It works, thank you very much

Quote:
Originally Posted by yanniss View Post
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.
 
  


Reply

Tags
el5



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removed accidently removed panel at Suse 11.1? alte_mann SUSE / openSUSE 6 01-29-2009 04:19 AM
Accidently removed the RPM DB rvbalraj Linux - Server 2 05-13-2008 09:41 PM
Accidently removed application bar amivit Slackware 3 10-24-2007 09:30 AM
HELP! accidently removed files RobHill Linux - General 2 06-01-2007 01:04 PM
dselect, removed necessary packages accidently eggsally Debian 3 06-02-2004 03:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration