LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2016, 05:28 AM   #1
marmarisko
LQ Newbie
 
Registered: Jan 2016
Posts: 4

Rep: Reputation: Disabled
libc.so.5 repair?


Hello. Is there any possibility on repairing /lib/libc.so.5 file? Somehow during apt-get upgrade on Debian 8.3 VPS it got truncated and now many packages won't work. It's production server so I'm a bit affraid now. Thanks.

Code:
~# gdb wget
(gdb) run
Starting program: /usr/bin/wget
Error while mapping shared library sections:
'/lib/libc.so.5': not in executable format: File truncated
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
Code:
~# ls -l /lib/
total 288
lrwxrwxrwx  1 root root    21 Oct 14 08:52 cpp -> /etc/alternatives/cpp
drwxr-xr-x  2 root root  4096 May  7  2015 discover
drwxr-xr-x  2 root root  4096 May  7  2015 ifupdown
drwxr-xr-x  2 root root  4096 May  7  2015 init
-rwxr-xr-x  1 root root 71416 Oct  5  2014 klibc-IpHGKKbZiB_yZ7GPagmQz2GwVAQ.so
-rwxr-xr-x  1 root root 23904 Jan 26 22:08 libc.so.5
lrwxrwxrwx  1 root root    17 Nov  8  2014 libip4tc.so.0 -> libip4tc.so.0.1.0
-rw-r--r--  1 root root 31416 Nov  8  2014 libip4tc.so.0.1.0
lrwxrwxrwx  1 root root    17 Nov  8  2014 libip6tc.so.0 -> libip6tc.so.0.1.0
-rw-r--r--  1 root root 31416 Nov  8  2014 libip6tc.so.0.1.0
lrwxrwxrwx  1 root root    15 Nov  8  2014 libipq.so.0 -> libipq.so.0.0.0
-rw-r--r--  1 root root 10544 Nov  8  2014 libipq.so.0.0.0
lrwxrwxrwx  1 root root    16 Nov  8  2014 libiptc.so.0 -> libiptc.so.0.0.0
-rw-r--r--  1 root root  5816 Nov  8  2014 libiptc.so.0.0.0
lrwxrwxrwx  1 root root    20 Nov  8  2014 libxtables.so.10 -> libxtables.so.10.0.0
-rw-r--r--  1 root root 51896 Nov  8  2014 libxtables.so.10.0.0
drwxr-xr-x  3 root root  4096 May  7  2015 lsb
drwxr-xr-x  2 root root  4096 May  7  2015 modprobe.d
drwxr-xr-x  3 root root  4096 May  7  2015 modules
drwxr-xr-x  2 root root  4096 May  7  2015 startpar
drwxr-xr-x  8 root root  4096 Jan 27 15:19 systemd
drwxr-xr-x 15 root root  4096 May  7  2015 terminfo
drwxr-xr-x  4 root root  4096 Jan 27 15:13 udev
drwxr-xr-x  4 root root 12288 Jan 27 15:20 x86_64-linux-gnu
drwxr-xr-x  2 root root  4096 May  7  2015 xtables
Code:
~# uname -a
Linux server1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux

Last edited by marmarisko; 01-29-2016 at 05:29 AM.
 
Old 01-29-2016, 10:09 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
For the simple one, you will have to boot the system with a recovery system... And see if that recovery system has the file you want - then just copy it back.


The longer one is to force the reinstall of the package containing libc (try dpkg --search /lib/libc.so.5, then reinstall that package (apt-get --reinstall <packagename>).

Note: I only have a Raspberry PI, and haven't done a lot with apt-get or dpkg, but this is what is indicated by the reference manual documentation.
 
Old 01-30-2016, 01:48 AM   #3
marmarisko
LQ Newbie
 
Registered: Jan 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
For the simple one, you will have to boot the system with a recovery system... And see if that recovery system has the file you want - then just copy it back.


The longer one is to force the reinstall of the package containing libc (try dpkg --search /lib/libc.so.5, then reinstall that package (apt-get --reinstall <packagename>).

Note: I only have a Raspberry PI, and haven't done a lot with apt-get or dpkg, but this is what is indicated by the reference manual documentation.
Thanks for reply but didn't help. I have no chance rebooting as it is VPS located in other country. :/ I've tried also searching using dpkg but with no luck. I've searched even on packages.debian.org but nothing.

I wanted to backup that truncated file file using cp but it gave me error cp: skipping file `libc.so.5', as it was replaced while being copied. Man I'm desperate.
 
Old 01-30-2016, 03:05 AM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
libc.so.5 is the old Linux libc, not the Gnu glibc libc.so.6 that has been used for years.

Where did you get it from?

It's not present in any of my Debian boxen or in any Debian repo's that I'm aware of.
 
Old 01-30-2016, 04:56 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I don't see any way to replace it without getting it from somewhere else ... and that will require a reboot using a system that has a valid copy.

libc.so.5 is very old... and support discontinued around 1997. The current libc version is 2.20 and on my system /lib/libc.so.6 is a symbolic link to it.

libc is the lowest level library and contains all the system calls, and is used by every program in the system.
 
Old 01-30-2016, 07:02 AM   #6
marmarisko
LQ Newbie
 
Registered: Jan 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by descendant_command View Post
libc.so.5 is the old Linux libc, not the Gnu glibc libc.so.6 that has been used for years.

Where did you get it from?

It's not present in any of my Debian boxen or in any Debian repo's that I'm aware of.
This is big question for me also. This Debian was pre-installed on my VPS server. First I though I could install a fresh copy of Debian on my PC and get that file from there but it wasn't present.

Then I wanted to remove libc.so.5 and replace it with libc.so.6 but copying failed with the message I wrote above.

I really don't know what to do now.
 
Old 01-30-2016, 07:08 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
You might have to add a symbolic link from libc.so.5 to point to libc.so.6

The problem is compatibility. libc.so.5 was not fully POSIX, libc.so.6 is more compatibly, and usually built for newer systems than what libc.so.5 systems would use. It may not work, or work partially.
 
Old 01-30-2016, 07:11 AM   #8
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You should really talk to your VPS provider about it.
 
  


Reply



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
I need a Linux OS other than Ubuntu which has a repair disk or repair software jhmac77 Linux - Newbie 1 03-17-2008 07:04 AM
g++ and libc kiran_kondru17 Linux - Newbie 1 11-27-2004 07:26 AM
libc.so.6(GLIBC_2.3), libc.so.6(GLIBC_2.3.2) needed for Linux 7.3.1 vivek_thampy Linux - Software 1 08-09-2004 04:12 PM
libc.so.6 alperen Linux - Software 1 09-15-2003 11:46 AM
libc.so verse libc.so.5 markstevens Linux - Software 4 06-19-2003 11:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:07 PM.

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