Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.