Centos 64 Bit Bad Elf Interpreter

CentOS 64 bit bad ELF interpreter

You're on a 64-bit system, and don't have 32-bit library support installed.

To install (baseline) support for 32-bit executables

(if you don't use sudo in your setup read note below)

Most desktop Linux systems in the Fedora/Red Hat family:

 pkcon install glibc.i686

Possibly some desktop Debian/Ubuntu systems?:

pkcon install ia32-libs

Fedora or newer Red Hat, CentOS:

 sudo dnf install glibc.i686

Older RHEL, CentOS:

   sudo yum install glibc.i686

Even older RHEL, CentOS:

  sudo yum install glibc.i386

Debian or Ubuntu:

   sudo apt-get install ia32-libs

should grab you the (first, main) library you need.

Once you have that, you'll probably need support libs

Anyone needing to install glibc.i686 or glibc.i386 will probably run into other library dependencies, as well. To identify a package providing an arbitrary library, you can use

 ldd /usr/bin/YOURAPPHERE

if you're not sure it's in /usr/bin you can also fall back on

 ldd $(which YOURAPPNAME)

The output will look like this:

    linux-gate.so.1 =>  (0xf7760000)
libpthread.so.0 => /lib/libpthread.so.0 (0xf773e000)
libSM.so.6 => not found

Check for missing libraries (e.g. libSM.so.6 in the above output), and for each one you need to find the package that provides it.

Commands to find the package per distribution family

Fedora/Red Hat Enterprise/CentOS:

 dnf provides /usr/lib/libSM.so.6

or, on older RHEL/CentOS:

 yum provides /usr/lib/libSM.so.6

or, on Debian/Ubuntu:

first, install and download the database for apt-file

 sudo apt-get install apt-file && apt-file update

then search with

 apt-file find libSM.so.6

Note the prefix path /usr/lib in the (usual) case; rarely, some libraries still live under /lib for historical reasons … On typical 64-bit systems, 32-bit libraries live in /usr/lib and 64-bit libraries live in /usr/lib64.

(Debian/Ubuntu organise multi-architecture libraries differently.)

Installing packages for missing libraries

The above should give you a package name, e.g.:

libSM-1.2.0-2.fc15.i686 : X.Org X11 SM runtime library
Repo : fedora
Matched from:
Filename : /usr/lib/libSM.so.6

In this example the name of the package is libSM and the name of the 32bit version of the package is libSM.i686.

You can then install the package to grab the requisite library using pkcon in a GUI, or sudo dnf/yum/apt-get as appropriate…. E.g pkcon install libSM.i686. If necessary you can specify the version fully. E.g sudo dnf install ibSM-1.2.0-2.fc15.i686.

Some libraries will have an “epoch” designator before their name; this can be omitted (the curious can read the notes below).

Notes

Warning

Incidentially, the issue you are facing either implies that your RPM (resp. DPkg/DSelect) database is corrupted, or that the application you're trying to run wasn't installed through the package manager. If you're new to Linux, you probably want to avoid using software from sources other than your package manager, whenever possible...

If you don't use "sudo" in your set-up

Type

su -c

every time you see sudo, eg,

su -c dnf install glibc.i686

About the epoch designator in library names

The “epoch” designator before the name is an artifact of the way that the underlying RPM libraries handle version numbers; e.g.

2:libpng-1.2.46-1.fc16.i686 : A library of functions for manipulating PNG image format files
Repo : fedora
Matched from:
Filename : /usr/lib/libpng.so.3

Here, the 2: can be omitted; just pkcon install libpng.i686 or sudo dnf install libpng-1.2.46-1.fc16.i686. (It vaguely implies something like: at some point, the version number of the libpng package rolled backwards, and the “epoch” had to be incremented to make sure the newer version would be considered “newer” during updates. Or something similar happened. Twice.)


Updated to clarify and cover the various package manager options more fully (March, 2016)

-jailshell: d-linux-x86-64.so.2: bad ELF interpreter: No such file or directory


I'm trying to install an executable but it gives me the error

This executable is corrupt.

It is trying to use d-linux-x86-64.so.2 as an interpreter, and such a file doesn't exist (nor should it exist) on your machine.

Chances are this executable was transferred over FTP in ASCII mode, or corrupted in some other way.

I have already checked if I have the glib 32-bit version

That is irrelevant: the binary you are trying to build is a 64-bit binary.

Also, there is a difference between glib and glibc.

bash: ./loopy: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Quoting howtodoityourself.org,

You need to install glibc.1686. Do it by:

yum -y install glibc.i686

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.

EDIT:

For your

 ./loopy: error while loading shared libraries:
libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file
or directory

error, try yum provides:

yum provides libstdc++-libc6.2-2.so.3

It will answer you like this:

compat-libstdc++-296.i386                2.96-135               core
Matched from:
libstdc++-libc6.2-2.so.3

Then, do a

yum install compat-libstdc++-296

/usr/bin/javac: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Looks like you unpacked a tar.gz file in /opt/. This version is obviously trying to use the 32bits /lib/ld-linux.so.2 . (The 64bits linker is /usr/lib64/ld-linux-x86-64.so.2 -> ld-2.17.so)

For EL7 please use the "rpm" 8u162
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html →
jdk-8u162-linux-x64.rpm :

# cd Downloads/ && yum install ./jdk-8u162-linux-x64.rpm

# alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_162/bin/java 2
# alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_162/bin/javac 2

# alternatives --config java
# alternatives --config javac

No issues ...



Related Topics



Leave a reply



Submit