LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   libc.so.5 repair? (https://www.linuxquestions.org/questions/linux-newbie-8/libc-so-5-repair-4175568290/)

marmarisko 01-29-2016 05:28 AM

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


jpollard 01-29-2016 10:09 AM

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.

marmarisko 01-30-2016 01:48 AM

Quote:

Originally Posted by jpollard (Post 5489390)
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.

descendant_command 01-30-2016 03:05 AM

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.

jpollard 01-30-2016 04:56 AM

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.

marmarisko 01-30-2016 07:02 AM

Quote:

Originally Posted by descendant_command (Post 5490231)
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.

jpollard 01-30-2016 07:08 AM

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.

descendant_command 01-30-2016 07:11 AM

You should really talk to your VPS provider about it.


All times are GMT -5. The time now is 12:34 AM.