LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   chroot: error while loading shared libraries: /lib/libc.so.6: file too short (http://www.linuxquestions.org/questions/debian-26/chroot-error-while-loading-shared-libraries-lib-libc-so-6-file-too-short-458539/)

ilyaz121 06-26-2006 05:07 PM

chroot: error while loading shared libraries: /lib/libc.so.6: file too short
 
Hi,
I was trying to check the library 'libc.so.6' using VI editor on Debian OS. When I tried to close VI editor, it got stuck and When I restarted the system, I got this error

chroot: error while loading shared libraries: /lib/libc.so.6: file too short
Kernel panic: Attempted to kill init!

Do I need to re-install the OS or is there any other method to overcome this problem.

Does anyone know the solution? Please help me.

Thanks in advance.
Kind Regards,
Ilyaz

nx5000 06-27-2006 02:47 AM

No need to reinstall, you can download the .deb from debian, extract it, take the file you want and put it in /lib

For this you need:
->To know which version of libc6 you have to take (ls /lib/libc* will tell you) Which release of debian do you have.
->An os that can write to your /lib, maybe a livecd

Tell me if it goes well.

Daws 06-27-2006 09:11 AM

Quote:

An os that can write to your /lib, maybe a livecd
Preferably a debian based livecd, ie one that has dpkg or some other way of manipulating .deb packages.

nx5000 06-27-2006 09:35 AM

Quote:

Originally Posted by Daws
Preferably a debian based livecd, ie one that has dpkg or some other way of manipulating .deb packages.

No need for dpkg, .deb is the old ar linux format:

Example on my machine (unstable):
Code:

bork@freedom:/tmp$ ll /lib/libc.so.6
lrwxrwxrwx 1 root root 13 2006-06-10 09:20 /lib/libc.so.6 -> libc-2.3.6.so
bork@freedom:/tmp$ wget http://ftp.fr.debian.org/debian/pool/main/g/glibc/libc6_2.3.6-15_i386.deb
bork@freedom:/tmp$ ar x libc6_2.3.6-15_i386.deb data.tar.gz
bork@freedom:/tmp$ tar xvjf data.tar.gz
root@freedom:/tmp# mount /mnt/pathtobrokendeb
root@freedom:/tmp# cp /mnt/pathtobrokendeb/lib/libc-2.3.6.so /mnt/pathtobrokendeb/lib/oldlibc-2.3.6.so
root@freedom:/tmp# cp /tmp/lib/libc-2.3.6.so /mnt/pathtobrokendeb/lib

Should work :)

edit: ermm ar is maybe not present if there is no compilation suite (gcc,..).
then dpkg
or ark (kde default decompressor)

Daws 06-27-2006 12:38 PM

I learn something new every day on LQ...

ilyaz121 06-30-2006 03:06 PM

Thank you very much for your help.


All times are GMT -5. The time now is 08:18 AM.