CentOS 64 位糟糕的 ELF 解释器
我刚刚安装了 CentOS 6 64 位版本,我尝试在 64 位计算机上安装 32 位应用程序并收到此错误:
/lib/ld-linux.so.2:错误的 ELF 解释器:没有这样的文件或目录
我该如何解决这个问题?
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
How do I resolve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
您使用的是 64 位系统,并且没有安装 32 位库支持。
要安装对 32 位可执行文件的(基准)支持
(如果您在设置中不使用 sudo,请阅读下面的注释)
Fedora/Red Hat 系列中的大多数桌面 Linux 系统:
可能是一些桌面 Debian/Ubuntu 系统?:
Fedora 或更新版本Red Hat、CentOS:
较旧的 RHEL、CentOS:
甚至较旧的 RHEL、CentOS:
Debian 或 Ubuntu:
应该会获取您需要的(第一个、主要)库。
一旦你有了这个,你可能需要支持库
任何需要安装 glibc.i686 或 glibc.i386 的人也可能会遇到其他库依赖项。要识别提供任意库的包,
如果您不确定它是否在
/usr/bin
中,您也可以使用输出将如下所示:
检查缺少的库(例如上面输出中的
libSM.so.6
),对于每一个,您都需要找到提供它的包。用于查找每个发行版系列的软件包的命令
Fedora/Red Hat Enterprise/CentOS:
或者,在较旧的 RHEL/CentOS 上:
或者,在 Debian/Ubuntu 上:
首先,安装并下载 apt-file 的数据库,
然后 进行搜索
在(通常)情况下使用注意前缀路径
/usr/lib
;很少,由于历史原因,一些库仍然存在于/lib
下……在典型的 64 位系统上,32 位库存在于/usr/lib
中,64 位库存在于/usr/lib
中在/usr/lib64
中。(Debian/Ubuntu 以不同的方式组织多架构库。)
为缺失的库安装软件包
上面应该给你一个软件包名称,例如:
在这个例子中,软件包的名称是
libSM
和 32位版本的包的名称是libSM.i686
。然后,您可以安装该软件包以在 GUI 中使用
pkcon
或适当时使用sudo dnf/yum/apt-get
来获取必需的库……。例如pkcon install libSM.i686
。如有必要,您可以完整指定版本。例如sudo dnf install ibSM-1.2.0-2.fc15.i686
。有些图书馆的名字前会有一个“纪元”指示符;这可以省略(好奇的可以阅读下面的注释)。
注释
警告
顺便说一句,您遇到的问题要么意味着您的 RPM(或 DPkg/DSelect)数据库已损坏,要么意味着您尝试运行的应用程序不是通过包管理器安装的。如果您是 Linux 新手,您可能希望尽可能避免使用软件包管理器以外来源的软件...
如果您不在设置中使用“sudo”
键入
,请在每次看到
时 sudo
,例如,关于库名称中的纪元指示符
名称之前的“纪元”指示符是底层 RPM 库处理版本号的方式的产物;例如
这里的
2:
可以省略;只需pkcon install libpng.i686
或sudo dnf install libpng-1.2.46-1.fc16.i686
。 (它模糊地暗示了这样的事情:在某个时刻,libpng
包的版本号向后滚动,并且“纪元”必须增加,以确保较新的版本在运行期间被认为是“较新的”更新。或者类似的事情发生了两次。)更新以更全面地阐明和涵盖各种包管理器选项(2016 年 3 月)
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)
刚刚在新安装的 CentOS 6.4 64 位机器上遇到了同样的问题。一个 yum 命令就可以解决这个问题以及 99% 的类似问题:
yum groupinstall "Compatibilitylibrary"
可以在该命令前面加上 'sudo' 前缀,也可以以 root 身份运行,以最适合您的方式为准。
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.
一般来说,当你收到这样的错误时,只需执行以下操作
,你就会看到类似的内容:
然后你只需像 BRPocock 所写的那样运行以下命令(如果你想知道逻辑是什么......):
In general, when you get an error like this, just do
then you'll see something like:
and then you just run the following like BRPocock wrote (in case you were wondering what the logic was...):
尝试
希望这能解决。
Try
Hope this clears out.
您还可以安装 OpenJDK 32 位 (
.i686
)。根据我的测试,它将安装并运行,没有问题。笔记:
请参阅此处了解更多详细信息。
You can also install OpenJDK 32-bit (
.i686
) instead. According to my test, it will be installed and works without problems.Note:
See here for more details.
只是想在 BRPocock 中添加评论,但我没有足够的权限。
因此,我的贡献是为每个尝试从 IBM 的 Integration Bus 捆绑包安装 IBM Integration Toolkit 的人提供的。
当您尝试从文件夹 /Integration_Toolkit/IM_Linux 运行“安装管理器”命令(要运行的文件是“install”)时,您会收到本文中显示的错误。
您可以在 IBM 的网页中找到解决此问题的进一步说明:
https://www-304.ibm.com/support/docview.wss ?uid=swg21459143
希望这对尝试安装它的人有所帮助。
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.
sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
我想补充一下,对于 Debian,系统中至少需要一个编译器(根据 Debian Stretch 和 Jessie 32 位库)。
我安装了 apt-get install -y gcc-multilib 以便在基于 debian:jessie 的 docker 容器中运行 32 位可执行文件。
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.就我而言,我已经使用命令 yum install redhat-lsb 解决了该问题
In my case, I have resolved the issue using command
yum install redhat-lsb