CentOS 64 bit bad ELF interpreter

匿名 (未验证) 提交于 2019-12-03 08:59:04

问题:

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?

回答1:

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

To install (baseline) support for 32-bit executables

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.

Warning

Incidentially, this 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 

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) 

Look over the output for missing libraries, and for each one, take its name (e.g. for libSM.so.6 => missing you would use libSM.so.6) and run:

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.)

This 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 

You can then pkcon install libSM.i686 (or specify the version fully: sudo dnf install ibSM-1.2.0-2.fc15.i686) to grab the requisite library. (Using pkcon in a GUI, or sudo dnf/yum/apt-get as appropriate…)

Some libraries will have an “epoch” designator before their name; this can be omitted, it's an artefact 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)



回答2:

Just came across the same problem on a freshly installed CentOS 6.4 64-bit machine. A single yum command will fix this plus 99% of similar problems:

yum groupinstall "Compatibility libraries"

Either prefix this with 'sudo' or run as root, whichever works best for you.



回答3:

In general, when you get an error like this, just do

yum provides ld-linux.so.2 

then you'll see something like:

glibc-2.20-5.fc21.i686 : The GNU libc libraries Repo        : fedora Matched from: Provides    : ld-linux.so.2 

and then you just run the following like BRPocock wrote (in case you were wondering what the logic was...):

yum install glibc.i686 


回答4:

Try

$ yum provides ld-linux.so.2 $ yum update $ yum install glibc.i686 libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6 

Hope this clears out.



回答5:

Just wanted to add a comment in BRPocock, but I don't have the sufficient privilegies.

So my contribution was for everyone trying to install IBM Integration Toolkit from IBM's Integration Bus bundle.

When you try to run "Installation Manager" command from folder /Integration_Toolkit/IM_Linux (the file to run is "install") you get the error showed in this post.

Further instructions to fix this problem you'll find in this IBM's web page: https://www-304.ibm.com/support/docview.wss?uid=swg21459143

Hope this helps for anybody trying to install that.



回答6:

sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6



回答7:

I would add for Debian you need at least one compiler in the system (according to Debian Stretch and Jessie 32-bit libraries ).

I installed apt-get install -y gcc-multilib in order to run 32-bit executable file in my docker container based on debian:jessie.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!