Debian Error While Loading Shared Libraries Libc.so.6
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top error while loading shared libraries: libc.so.6: cannot open shared object file up vote 2 down vote favorite I have a Linux kernel and I chroot it on /var/chroot: I added bash dependencies like so: ldd /bin/bash linux-vdso.so.1 => (0x00007fff9a373000) libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f24d57af000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f24d55ab000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f24d51eb000) /lib64/ld-linux-x86-64.so.2 (0x00007f24d59f8000) Then I did: # cd /var/chroot/ # mkdir bin/ lib64/ lib/ # cp /lib/x86_64-linux-gnu/libtinfo.so.5 lib/ # cp /lib/x86_64-linux-gnu/libdl.so.2 lib/ # cp /lib/x86_64-linux-gnu/libc.so.6 lib/ # cp /lib64/ld-linux-x86-64.so.2 lib64/ # cp /bin/bash bin/ after that: # chroot /var/chroot After that I copied /bin/ls and the libraries shown by ldd ls. But when I run ls I have the following error: ls: error while loading shared libraries: libpthread.so.0: wrong ELF class: ELFCLASS32 libraries chroot dynamic-linking share|improve this question edited Jan 15 '15 at 23:59 Gilles 370k686731123 asked Jan 15 '15 at 10:43 MLSC 4071919 There are standard ways to create chroots. I recommend you use them. The details depend to some extent on your distribution, which you have not stated. –Faheem Mitha Jan 15 '15 at 12:03 It would probably be more useful to have the ldd output of the chrooted executable instead, since it's the one which is causing trouble... Besides, there doesn't seem to be any "no such file in directory" error involved. –John WH Smith Jan 16 '15 at 0:16 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted Since you were apparently able to launch bash, you have the basics right: you need to copy all the libraries listed by ldd /bin/command to a directory on the library load path, plus the loader itself (/lib64/ld-linux-x86-64.so.2) which needs to be at the location hard-coded in
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Accidentally deleted symlink libc.so.6 in CentOS 6.4. How to get sudo privilege to re-create it? up vote 1 http://unix.stackexchange.com/questions/179233/error-while-loading-shared-libraries-libc-so-6-cannot-open-shared-object-file down vote favorite 1 I accidentally deleted the symbol link /lib64/libc.so.6 -> /lib64/libc-2.12.so with $ sudo rm libc.so.6 Then I can not use anything including ls command. The error appears for any command I type ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory I've tried $ export LD_PRELOAD=/lib64/libc-2.12.so After this I can use ls and ln ..., but still can not use sudo ln ..., sudo -E ln ..., sudo su http://serverfault.com/questions/519664/accidentally-deleted-symlink-libc-so-6-in-centos-6-4-how-to-get-sudo-privilege or even su. I always get this err sudo: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory or su: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory It seems LD_PRELOAD works only for the current shell session of my account, but not for a new account like root or a new session. It's a remote server so I can not use a live CD. I now have a ssh bash session alive but can not establish new ones. I have sudo privilege, but don't have root password. So currently my problem is I need to run sudo sln -s libc-2.12.so libc.so.6 to re-create the symlink libc.so.6, but I can not run sudo without libc.so.6. How can I fix it? Thanks~ linux centos sudo root glibc share|improve this question edited Jun 30 '13 at 6:40 asked Jun 30 '13 at 6:20 kangshiyin 10816 which version of kernel do you use? –ALex_hha Jul 3 '13 at 11:03 @ALex_hha 2.6.32-358.6.2.el6.x86_64 –kangshiyin Jul 3 '13 at 11:21 Unfortunately, packetstormsecurity.com/files/121616/semtex.c will not work –ALex_hha Jul 3 '13 at 11:52 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote accepted The best thing to do in this case by far is to boot the server using a livecd, mount the applicable partitions, and create the
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki https://ubuntuforums.org/showthread.php?t=1984550 Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation http://www.linuxquestions.org/questions/linux-newbie-8/error-while-loading-shared-libraries-wrong-elf-class-elfclass32-4175491402/ Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Installation & Upgrades [ubuntu] error while loading shared libraries: libc.so.6 Having debian error an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Results 1 to 4 of 4 Thread: error while loading shared libraries: libc.so.6 Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode May 22nd, 2012 debian error while #1 eekrazyk View Profile View Forum Posts Private Message 5 Cups of Ubuntu Join Date Feb 2007 Beans 26 error while loading shared libraries: libc.so.6 I'm running a 64-bit Ubuntu Server 11.10 and am attempting to install an old 32-bit tool for work. The installer is a script that sets some environment variables then attempts to create a director under /tmp. This is where it fails with the following error: Code: $ sudo ./setup mkdir: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory ERROR: Could not make directory in /tmp This is the problem line from the installer script: Code: if [ -d "/tmp/windu" ] then /bin/rm -rf /tmp/windu fi mkdir -p /tmp/windu if [ $? -ne 0 ] then echo "ERROR: Could not make directory in /tmp" exit 1; fi Code: $ ldd bin/lin/windu_registryd44 linux-gate.so.1 => (0xf77ac000) libpthread.so.0 => /lib32/libpthread.so.0 (0xf7772000) libcrypt.so.1 => /lib32/libcrypt.so.1 (0xf7741000) libm.so.6 => /lib32/libm.so.6 (0xf7716000) libc.so.6 => /lib32/libc.so.6 (0xf759c000) libnsl.so.1 => /lib32/libnsl.so.1 (0xf7583000) /lib/ld-linux.so.2 (0xf77ad000) I have installed ia32-libs. I'm not finding much on the forums for this
Search HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie [SOLVED] Error while loading shared libraries - wrong ELF class: ELFCLASS32 User Name Remember Me? 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 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. Are you new to LinuxQuestions.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now 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. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 01-15-2014, 01:15 PM #1 CowboyRT LQ Newbie Registered: Jan 2014 Posts: 7 Rep: Error while loading shared libraries - wrong ELF class: ELFCLASS32 I am currently running CentOS 6.5 64-bit. I am attempting to install a 32-bit application and I'm getting the error below during the application install. error while loading shared libraries: libc.so.6: wrong ELF class: ELFCLASS32 /tmp/eiecho: error while loading shared libraries: libm.so.6: cannot open shared object file: No s