How to fix /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Hello,

I encountered several days ago this error on a fresh installed CentOS 6 – 64 bit machine while installing some game redirection software from CsServers.ro. This will happen only on 64 bit systems, the cause is the fact that 32 bit libraries are missing from the system, so you can easily fix this issue by installing the 32 bit libraries on your system.

So if you encounter this error /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory this is how you can fix it:

On any RPM based distribution (CentOS/RedHat/Fedora/Suse/Mandriva):

yum -y install glibc.i686

On any DEB based distribution (Debian/Ubuntu/Mint/Crunchbang):

apt-get update
apt-get install ia32-libs

74 thoughts on “How to fix /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory”

  1. i tried it, but my command yum -y install glibc.i686 give me “No package glibc.i686 available. Error: Nothing to do”

    what should i do in order to get this lib working for some old application?

    thanks

    Reply
    • Hello,

      What distribution are you using? (name and version)
      Please provide me the output of the command yum search glibc
      You should get an output similar to this:
      glibc-common.x86_64 : Common binaries and locale data for glibc
      compat-glibc.x86_64 : Compatibility C library
      compat-glibc-headers.x86_64 : Header files for development using standard C libraries.
      glibc.i686 : The GNU libc libraries
      glibc.x86_64 : The GNU libc libraries
      glibc-devel.i686 : Object files for development using standard C libraries.
      glibc-devel.x86_64 : Object files for development using standard C libraries.
      glibc-headers.x86_64 : Header files for development using standard C libraries.
      glibc-static.i686 : C library static libraries for -static linking.
      glibc-static.x86_64 : C library static libraries for -static linking.
      glibc-utils.x86_64 : Development utilities from GNU C library
      kernel-headers.x86_64 : Header files for the Linux kernel for use by glibc
      latrace.i686 : LD_AUDIT feature frontend for glibc 2.4+
      latrace.x86_64 : LD_AUDIT feature frontend for glibc 2.4+
      nss-mdns.i686 : glibc plugin for .local name resolution
      nss-mdns.x86_64 : glibc plugin for .local name resolution

      Reply
      • Hi, Im getting same error. The bad ELF interpreter. and when I run the command, output is:

        [[email protected] linuxi38664h]# yum search glibc
        Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
        This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.
        ========================================================================= N/S matched: glibc ==========================================================================
        glibc-common.x86_64 : Common binaries and locale data for glibc
        compat-glibc.x86_64 : Compatibility C library
        compat-glibc-headers.x86_64 : Header files for development using standard C libraries.
        glibc.i686 : The GNU libc libraries
        glibc.x86_64 : The GNU libc libraries
        glibc-devel.i686 : Object files for development using standard C libraries.
        glibc-devel.x86_64 : Object files for development using standard C libraries.
        glibc-headers.x86_64 : Header files for development using standard C libraries.
        glibc-utils.x86_64 : Development utilities from GNU C library
        kdesdk-kmtrace.x86_64 : Assist with malloc debugging using glibc’s “mtrace” functionality
        kernel-headers.x86_64 : Header files for the Linux kernel for use by glibc
        latrace.i686 : LD_AUDIT feature frontend for glibc 2.4+
        latrace.x86_64 : LD_AUDIT feature frontend for glibc 2.4+

        Name and summary matches only, use “search all” for everything.

        –appreciate your response

        Reply
  2. Hello, I am running into this very issue and was given the same “no package glibc.i686 available error” Running CentOS 5.7

    Here is my output:

    [[email protected] ringmaster]# yum search glibc
    Loaded plugins: fastestmirror, protectbase
    Loading mirror speeds from cached hostfile
    * base: mirrors.cicku.me
    * extras: mirror.stanford.edu
    * updates: mirrors.arpnetworks.com
    Excluding Packages in global exclude list
    Finished
    0 packages excluded due to repository protections
    =================================================== Matched: glibc ===================================================
    compat-glibc.x86_64 : Compatibility C library
    compat-glibc-headers.x86_64 : Header files for development using standard C libraries.
    glibc.x86_64 : The GNU libc libraries.
    glibc-common.x86_64 : Common binaries and locale data for glibc
    glibc-devel.x86_64 : Object files for development using standard C libraries.
    glibc-headers.x86_64 : Header files for development using standard C libraries.
    glibc-utils.x86_64 : Development utilities from GNU C library
    kernel-headers.x86_64 : Header files for the Linux kernel for use by glibc
    nss_db.x86_64 : An NSS library for the Berkeley DB.
    perl-Crypt-Memfrob.noarch : Memfrob implementation in pure Perl
    python-utmp.x86_64 : Python module for working with utmp
    yp-tools.x86_64 : NIS (or YP) client programs.
    yum-protect-packages.noarch : Yum plugin to prevents Yum from removing itself and other protected packages

    Reply
    • Hi, thank you for posting the issue and the solution.
      I saw from your previous post that you have glibc.i686 available.
      Somebody must have altered your yum.conf, because by default there should be no exclude rule.
      Glad that you sorted out the issue.

      Reply
  3. I’m also receiving the “/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory” error. I did try your suggestion to reinstall glibc.i686, but received the below message stating no actions need taken.

    I’m not sure how to resolve this issue, and was wondering if you could help? Thank you

    [[email protected]]# yum -y install glibc.i686
    Gathering header information file(s) from server(s)
    Server: CentOS-4AS Base
    Server: Red Hat Linux 4AS Updates
    Finding updated packages
    Downloading needed headers
    glibc is installed and is the latest version.
    glibc is installed and is the latest version.
    No actions to take

    Reply
  4. Hello,

    use the command “yum provides ld-linux.so.2”

    This will indicate in which package this file is in.
    Then all you have to do is run “yum install glibc???” as supplied in the above command.

    Reply
  5. Hi, I have the same problem here.I need install glibc.i686. When I run the command”yum search glibc”, it shows:
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    ============================== N/S Matched: glibc ==============================
    glibc-common.x86_64 : Common binaries and locale data for glibc
    glibc.x86_64 : The GNU libc libraries
    glibc-devel.x86_64 : Object files for development using standard C libraries.
    glibc-headers.x86_64 : Header files for development using standard C libraries.
    kernel-headers.x86_64 : Header files for the Linux kernel for use by glibc
    latrace.x86_64 : LD_AUDIT feature frontend for glibc 2.4+

    Name and summary matches only, use “search all” for everything.

    So I can’t install glibc.i686. Please tell me how should I do.

    Reply
  6. Hi, I have the same issue, on RHEL6 (6.3) distro is definitely 64bit.
    yum search glibc shows:
    Loaded plugins: product-id, security, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    ===== N/S Matched: glibc ====
    glibc-common.x86_64 : Common binaries and locale data for glibc
    glibc.x86_64 : The GNU libc libraries
    latrace.x86_64 : LD_AUDIT feature frontend for glibc 2.4+

    yum provides ld-linux.so.2
    Loaded plugins: product-id, security, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    Warning: 3.0.x versions of yum would erroneously match against filenames.
    You can use “*/ld-linux.so.2” and/or “*bin/ld-linux.so.2” to get that behaviour
    No Matches found

    yum -y install glibc.i686
    Loaded plugins: product-id, security, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    Setting up Install Process
    No package glibc.i686 available.
    Error: Nothing to do

    Any help would be appreciated.

    Reply
  7. i tried it, but my command yum -y install glibc.i686 give me “No package glibc.i686 available. Error: Nothing to do”

    when m installing oracle 10g 10.2.0 version in RHEL 6 64 bit..

    [[email protected] ~]# yum -y install glibc.i686
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    Setting up Install Process
    No package glibc.i686 available.
    Error: Nothing to do

    likethis showing what to do can u plz tel me the solution…? cristian

    Reply
    • Hello,

      Add this to your yum repositories:

      [updates]
      name=CentOS-$releasever - Updates
      mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
      #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

      Then do a yum update and you should have glibc.i686 available, here is the proof:
      [[email protected]]# yum info glibc.i686
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
      * base: centos.mirror.linuxwerk.com
      * epel: mirrors.n-ix.net
      * extras: centos.schlundtech.de
      * updates: centos.mirror.linuxwerk.com
      Available Packages
      Name : glibc
      Arch : i686
      Version : 2.12
      Release : 1.107.el6_4.4
      Size : 4.3 M
      Repo : updates
      Summary : The GNU libc libraries
      URL : http://sources.redhat.com/glibc/
      License : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
      Description : The glibc package contains standard libraries which are used by
      : multiple programs on the system. In order to save disk space and
      : memory, as well as to make upgrading easier, common system code is
      : kept in one place and shared between programs. This particular package
      : contains the most important sets of shared libraries: the standard C
      : library and the standard math library. Without these two libraries, a
      : Linux system will not function.

      Reply
  8. After I installed yum -y install glibc.i686 the below erroris showing.

    Loaded plugins: fastestmirror, list-data, post-transaction-actions, protectbase, refresh-
    : packagekit, security, versionlock
    Loading mirror speeds from cached hostfile
    * base: mirror.leapswitch.com
    * extras: mirror.leapswitch.com
    * updates: mirror.leapswitch.com
    0 packages excluded due to repository protections
    Setting up Install Process
    Resolving Dependencies
    –> Running transaction check
    —> Package glibc.i686 0:2.12-1.107.el6_4.5 will be installed
    –> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.107.el6_4.5.i686
    –> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.107.el6_4.5.i686
    –> Running transaction check
    —> Package nss-softokn-freebl.i686 0:3.14.3-3.el6_4 will be installed
    –> Finished Dependency Resolution

    Dependencies Resolved

    ===================================================================================================
    Package Arch Version Repository Size
    ===================================================================================================
    Installing:
    glibc i686 2.12-1.107.el6_4.5 updates 4.3 M
    Installing for dependencies:
    nss-softokn-freebl i686 3.14.3-3.el6_4 updates 129 k

    Transaction Summary
    ===================================================================================================
    Install 2 Package(s)

    Total download size: 4.5 M
    Installed size: 13 M
    Downloading Packages:
    (1/2): glibc-2.12-1.107.el6_4.5.i686.rpm | 4.3 MB 00:13
    (2/2): nss-softokn-freebl-3.14.3-3.el6_4.i686.rpm | 129 kB 00:00
    —————————————————————————————————
    Total 309 kB/s | 4.5 MB 00:14
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Warning: RPMDB altered outside of yum.
    Installing : glibc-2.12-1.107.el6_4.5.i686 1/2
    Installing : nss-softokn-freebl-3.14.3-3.el6_4.i686 2/2
    Verifying : nss-softokn-freebl-3.14.3-3.el6_4.i686 1/2
    Verifying : glibc-2.12-1.107.el6_4.5.i686 2/2

    Installed:
    glibc.i686 0:2.12-1.107.el6_4.5

    Dependency Installed:
    nss-softokn-freebl.i686 0:3.14.3-3.el6_4

    Complete!
    [[email protected] me]# skype
    /opt/skype/skype: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

    Reply
  9. 1、my system is redhat 64bit
    2、my command yum -y install glibc.i686 give me “No package glibc.i686 available. Error: Nothing to do”.
    3、yum search glibc.give me :
    glibc-common.x86_64 : Common binaries and locale data for glibc
    glibc.x86_64 : The GNU libc libraries
    glibc-devel.x86_64 : Object files for development using standard C libraries.
    glibc-headers.x86_64 : Header files for development using standard C libraries.
    kernel-headers.x86_64 : Header files for the Linux kernel for use by glibc
    latrace.x86_64 : LD_AUDIT feature frontend for glibc 2.4+
    4、yum.conf:
    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1
    installonly_limit=3

    how to Solve ?think you.I have tried many times,but failed

    Reply
  10. hi…
    iam having problem in installing xcrysden software
    after all the installation process when iam trying to run the program iam getting the following result

    XCrySDen – (X-Window) CRYstalline Structures and DENsities *|
    |* = === = === *|
    |*————————————————————–*|
    |* *|
    |* Anton Kokalj ([email protected]) *|
    |* Jozef Stefan Institute, Ljubljana, Slovenia *|
    |* *|
    |* Copyright (c) 1996–2009 by Anton Kokalj *|
    |* *|
    |****************************************************************|
    +—————————————————————-+

    Version: 1.5.24

    Please report bugs to: [email protected]

    TERMS OF USE:
    ————-
    XCRYSDEN is released under the GNU General Public License.

    Whenever graphics generated by XCRYSDEN are used in scientific
    publications, it shall be greatly appreciated to include an explicit
    reference. The preferred form is the following:

    [ref] A. Kokalj, Comp. Mater. Sci., Vol. 28, p. 155, 2003.
    Code available from http://www.xcrysden.org/.

    TCL_LIBRARY=/home/YM/XCrySDen-1.5.24-bin-semishared/external/lib/tcl8.5
    XCRYSDEN_TOPDIR=/home/YM/XCrySDen-1.5.24-bin-semishared
    XCRYSDEN_SCRATCH=/home/YM/xcrys_tmp

    /home/YM/XCrySDen-1.5.24-bin-semishared/bin/xcrys: error while loading shared libraries: libXmu.so.6: cannot open shared object file: No such file or directory
    [[email protected] YM]#

    KINDLY GIVE ANY SOLUTION!!!!!!!!

    Reply
    • Hi,

      You need libXmu, just do a “yum search libxmu” your output should be something like this:
      libXmu.i686 : X.Org X11 libXmu/libXmuu runtime libraries
      libXmu.x86_64 : X.Org X11 libXmu/libXmuu runtime libraries
      libXmu-devel.i686 : X.Org X11 libXmu development package
      libXmu-devel.x86_64 : X.Org X11 libXmu development package

      Reply
  11. Hello,

    I’m trying to do a fw upgrade on blades HS22 and also have the same error:

    [[email protected] firmware]# ./upgrade.sh
    Firmware upgrading start …
    Start upgrading IMM …
    ./upgrade.sh: ./ibm_fw_imm_yuoog2c-1.42_linux_32-64.bin: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
    Upgrading IMM failed.
    Upgrading aborted.

    Redhat version is:
    [[email protected] firmware]# uname -a
    Linux nbg1syslog1.mgmt.nbg1.orange.es 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

    When I do yum search all glibc I only have:
    [[email protected] yum.repos.d]# yum search all glibc
    Loaded plugins: product-id, security, subscription-manager
    Updating certificate-based repositories.
    ============================================================================================================== Matched: glibc ===============================================================================================================
    glibc-common.x86_64 : Common binaries and locale data for glibc
    glibc.x86_64 : The GNU libc libraries
    latrace.x86_64 : LD_AUDIT feature frontend for glibc 2.4+
    yp-tools.x86_64 : NIS (or YP) client programs

    On repository I have the following:
    [[email protected] yum.repos.d]# more redhat.repo
    #
    # Certificate-Based Repositories
    # Managed by (rhsm) subscription-manager
    #
    [[email protected] yum.repos.d]# more rhel-source.repo
    [rhel-source]
    name=Red Hat Enterprise Linux $releasever – $basearch – Source
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

    [rhel-source-beta]
    name=Red Hat Enterprise Linux $releasever Beta – $basearch – Source
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

    What can I do to fix this issue?
    Could you help me please?

    Thank you in advance.
    best regards,
    Nadine

    Reply
    • You only list the source repositories. Do you have the rhel repo set?
      Also a different way is just to use the RHEL official DVD (or set up centos repo if you can do that), mount it in /mnt/rheldvd and add this in yum.repos.d:

      [rheldvd]
      name=Red Hat Enterprise Linux $releasever - $basearch - DVD
      baseurl=file:///mnt/rheldvd
      enabled=1
      gpgcheck=0

      This is the repository that provides glibc.i686 on centos (you may find this info with “repoquery -i glibc.i686”):
      #released updates
      [updates]
      name=CentOS-$releasever - Updates
      mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
      #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

      Reply
  12. I also get /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory when I try to run a file. All my permissions are set right but I am still getting that error. Any help would be very appreciated…

    Reply
  13. Hello, my server is in a isolated environment and it can’t use yum command. how can I install glibc.i686 without yum?

    Reply
  14. Received the following error
    [[email protected] ~]# isql -U sa -S T10
    bash: /opt/sybase/OCS-15_0/bin/isql: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    Tried the following work around to fix it but was unsuccessful..
    [[email protected] ~]# yum -y install glibc.i686
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    Setting up Install Process
    No package glibc.i686 available.
    Error: Nothing to do

    Environment: Installed SAP Sybase ASE 15.7 SP101 on RHEL 6.5 ontop on VMware 11 on windows 8.1 OS.

    Pls help
    Regards
    Rajesh

    Reply
  15. The 2 commands below will solve all your problems

    sudo yum install glibc-common glibc (mutual dependency)
    sudo yum install glibc.i686 (the missing version)

    let me know if you still have issues

    Reply
  16. error while loading shared libraries: libstdc++.so.6: can not open shared object file: No such file or directory ? Fix pls ?

    Reply
  17. am using RedHat 6, i iinstalled it today and a i tried “yum -y install glibc.i686” it is showing error in downloading,,please help me

    Reply
  18. same error for me in linux 6.5 64bit.

    [[email protected] DUMP]# yum -y install libstdc++.i686
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    Setting up Install Process
    No package libstdc++.i686 available.
    Error: Nothing to do

    Reply
  19. I received the same problem
    /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    System:
    Virtual Box 5.1.16 running Fedora Fedora-Workstation-Live-x86_64-24-1.2.iso
    Linux localhost.localdomain 4.7.6-200.fc24.x86_64 #1 SMP Mon Oct 3 20:10:24 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

    Solution:
    yum install glibc.i686

    Hopefully this helps someone else and thanks to Cristian!

    Reply
  20. Hi ,

    I am also facing same issues in my enivornment (nonadmin) ! when i try to fix this problem with the following ones
    sudo yum install glibc-common glibc (mutual dependency)
    sudo yum install glibc.i686 (the missing version)

    Thanks/
    Pavan

    Reply
  21. Hi,
    I am also facing the issue:

    sgdemi000526:/srv/jas/tmp/tmp/pai_tmp/InstallationManager # ./installc
    bash: ./installc: No such file or directory
    sgdemi000526:/srv/jas/tmp/tmp/pai_tmp/InstallationManager #

    sgdemi000526:/srv/jas/tmp/tmp/pai_tmp/InstallationManager # file installc
    installc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 2.6.9, not stripped
    sgdemi000526:/srv/jas/tmp/tmp/pai_tmp/InstallationManager #

    sgdemi000526:/srv/jas/tmp/pai_tmp/InstallationManager # readelf -a ./installc | grep “Requesting program interpreter”
    [Requesting program interpreter: /lib/ld-linux.so.2]
    sgdemi000526:/srv/jas/tmp/pai_tmp/InstallationManager #

    I am using SUSE Linux Enterprise Server 12 SP4.

    sgdemi000526:/srv/jas/tmp/pai_tmp/InstallationManager # zypper search glibc
    Refreshing service ‘spacewalk’.
    Loading repository data…
    Reading installed packages…

    S | Name | Summary | Type
    —+———————+——————————————————-+——–
    i+ | glibc | Standard Shared Libraries (from the GNU C Library) | package
    | glibc-32bit | Standard Shared Libraries (from the GNU C Library) | package
    i | glibc-devel | Include Files and Libraries Mandatory for Development | package
    | glibc-devel-32bit | Include Files and Libraries Mandatory for Development | package
    | glibc-devel-static | C library static libraries for -static linking | package
    | glibc-html | HTML Documentation for the GNU C Library | package
    i | glibc-i18ndata | Database Sources for ‘locale’ | package
    | glibc-info | Info Files for the GNU C Library | package
    i+ | glibc-locale | Locale Data for Localized Programs | package
    | glibc-locale-32bit | Locale Data for Localized Programs | package
    | glibc-profile | Libc Profiling and Debugging Versions | package
    | glibc-profile-32bit | Libc Profiling and Debugging Versions | package
    i | linux-glibc-devel | Linux headers for userspace development | package
    sgdemi000526:/srv/jas/tmp/pai_tmp/InstallationManager #

    Please let me know how to proceed

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.