I have just installed CentOS 6 64bit version, I'm trying to install a 32-bit application on a 64-bit machine and got this error:
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
I'm new to linux. How do I resolve this?
32bit-64bitcentoscentos6elflinux
I have just installed CentOS 6 64bit version, I'm trying to install a 32-bit application on a 64-bit machine and got this error:
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
I'm new to linux. How do I resolve this?
Best Answer
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:
Possibly some desktop Debian/Ubuntu systems?:
Fedora or newer Red Hat, CentOS:
Older RHEL, CentOS:
Even older RHEL, CentOS:
Debian or Ubuntu:
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
orglibc.i386
will probably run into other library dependencies, as well. To identify a package providing an arbitrary library, you can useif you're not sure it's in
/usr/bin
you can also fall back onThe output will look like this:
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:
or, on older RHEL/CentOS:
or, on Debian/Ubuntu:
first, install and download the database for
apt-file
then search with
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.:
In this example the name of the package is
libSM
and the name of the 32bit version of the package islibSM.i686
.You can then install the package to grab the requisite library using
pkcon
in a GUI, orsudo dnf/yum/apt-get
as appropriate…. E.gpkcon install libSM.i686
. If necessary you can specify the version fully. E.gsudo 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
every time you see
sudo
, eg,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.
Here, the
2:
can be omitted; justpkcon install libpng.i686
orsudo dnf install libpng-1.2.46-1.fc16.i686
. (It vaguely implies something like: at some point, the version number of thelibpng
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)