Linux CentOS 64 位错误的 ELF 解释器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8328250/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CentOS 64 bit bad ELF interpreter
提问by c11ada
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:
我刚刚安装了 CentOS 6 64 位版本,我正在尝试在 64 位机器上安装 32 位应用程序并收到此错误:
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
/lib/ld-linux.so.2: 错误的 ELF 解释器:没有那个文件或目录
I'm new to linux. How do I resolve this?
我是 linux 新手。我该如何解决?
采纳答案by BRPocock
You're on a 64-bit system, and don't have 32-bit library support installed.
您使用的是 64 位系统,并且没有安装 32 位库支持。
To install (baseline) support for 32-bit executables
安装(基线)对 32 位可执行文件的支持
(if you don't use sudo in your setup read note below)
(如果您在设置中不使用 sudo,请阅读下面的注释)
Most desktop Linux systems in the Fedora/Red Hat family:
Fedora/Red Hat 系列中的大多数桌面 Linux 系统:
pkcon install glibc.i686
Possibly some desktop Debian/Ubuntu systems?:
可能是一些桌面 Debian/Ubuntu 系统?:
pkcon install ia32-libs
Fedora or newer Red Hat, CentOS:
Fedora 或更新的 Red Hat、CentOS:
sudo dnf install glibc.i686
Older RHEL, CentOS:
较旧的 RHEL、CentOS:
sudo yum install glibc.i686
Even older RHEL, CentOS:
更旧的 RHEL、CentOS:
sudo yum install glibc.i386
Debian or Ubuntu:
Debian 或 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
任何需要安装glibc.i686
或glibc.i386
可能会遇到其他库依赖项的人,以及。要识别提供任意库的包,您可以使用
ldd /usr/bin/YOURAPPHERE
if you're not sure it's in /usr/bin
you can also fall back on
如果你不确定它在里面,/usr/bin
你也可以依靠
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.
检查缺少的库(例如libSM.so.6
在上面的输出中),对于每个库,您需要找到提供它的包。
Commands to find the package per distribution family
用于查找每个分发系列的包的命令
Fedora/Red Hat Enterprise/CentOS:
Fedora/红帽企业/CentOS:
dnf provides /usr/lib/libSM.so.6
or, on older RHEL/CentOS:
或者,在较旧的 RHEL/CentOS 上:
yum provides /usr/lib/libSM.so.6
or, on Debian/Ubuntu:
或者,在 Debian/Ubuntu 上:
first, install and download the database for apt-file
首先,安装并下载数据库 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
.
注意/usr/lib
(通常)情况下的前缀路径;很少,/lib
由于历史原因,一些库仍然存在……在典型的 64 位系统上,32/usr/lib
位库存在于/usr/lib64
.
(Debian/Ubuntu organise multi-architecture libraries differently.)
(Debian/Ubuntu 以不同的方式组织多架构库。)
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
.
在这个例子中,包的名称是libSM
和的包的32位版本的名称是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
.
然后,您可以安装该软件包以pkcon
在 GUI 中使用必要的库,或sudo dnf/yum/apt-get
根据需要……。例如pkcon install libSM.i686
。如有必要,您可以完全指定版本。例如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...
顺便说一句,您面临的问题要么意味着您的 RPM(或 DPkg/DSelect)数据库已损坏,要么您尝试运行的应用程序不是通过包管理器安装的。如果您是 Linux 新手,您可能希望尽可能避免使用包管理器以外的来源的软件...
If you don't use "sudo" in your set-up
如果您没有在设置中使用“sudo”
Type
类型
su -c
every time you see sudo
, eg,
每次你看到sudo
,例如,
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.
名称前的“纪元”指示符是底层 RPM 库处理版本号方式的产物;例如
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.)
这里,2:
可以省略;只是pkcon install libpng.i686
或sudo dnf install libpng-1.2.46-1.fc16.i686
. (它含糊地暗示着这样的事情:在某些时候,libpng
包的版本号向后滚动,并且必须增加“纪元”以确保更新期间将较新的版本视为“较新”。或者类似的事情发生了。两次.)
Updatedto clarify and cover the various package manager options more fully (March, 2016)
更新以更全面地阐明和涵盖各种包管理器选项(2016 年 3 月)
回答by Phil Edwards
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:
刚刚在新安装的 CentOS 6.4 64 位机器上遇到了同样的问题。一个 yum 命令将解决这个问题以及 99% 的类似问题:
yum groupinstall "Compatibility libraries"
yum groupinstall “兼容库”
Either prefix this with 'sudo' or run as root, whichever works best for you.
使用“sudo”作为前缀或以 root 身份运行,以最适合您的方式运行。
回答by mmarquezvacas
Just wanted to add a comment in BRPocock, but I don't have the sufficient privilegies.
只是想在 BRPocock 中添加评论,但我没有足够的权限。
So my contribution was for everyone trying to install IBM Integration Toolkit from IBM's Integration Bus bundle.
所以我的贡献是为所有尝试从 IBM 的 Integration Bus 包安装 IBM Integration Toolkit 的人提供帮助。
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.
当您尝试从文件夹 /Integration_Toolkit/IM_Linux(要运行的文件是“install”)运行“安装管理器”命令时,您会收到这篇文章中显示的错误。
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
您可以在此 IBM 网页中找到解决此问题的进一步说明:https: //www-304.ibm.com/support/docview.wss?uid=swg21459143
Hope this helps for anybody trying to install that.
希望这对任何尝试安装它的人都有帮助。
回答by Moe Singh
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...):
然后你就像 BRPocock 写的那样运行以下命令(以防你想知道逻辑是什么......):
yum install glibc.i686
回答by Nithin
sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
须藤 yum 安装 fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
回答by The Bumpaster
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.
希望这会清除。
回答by Vitaliy
I would add for Debian you need at least one compiler in the system (according to Debian Stretch and Jessie 32-bit libraries).
我想为 Debian 添加系统中至少需要一个编译器(根据Debian Stretch 和 Jessie 32 位库)。
I installed apt-get install -y gcc-multilib
in order to run 32-bit executable file in my docker container based on debian:jessie.
我安装apt-get install -y gcc-multilib
是为了在基于 debian:jessie 的 docker 容器中运行 32 位可执行文件。
回答by Mir-Ismaili
You can also install OpenJDK 32-bit (.i686
) instead. According to my test, it will be installed and works without problems.
您也可以安装 OpenJDK 32 位 ( .i686
)。根据我的测试,它将被安装并正常工作。
sudo yum install java-1.8.0-openjdk.i686
Note:
笔记:
The java-1.8.0-openjdkpackage contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.8.0-openjdk-develpackage.
在Java的1.8.0-的OpenJDK包包含只是Java运行时环境。如果要开发 Java 程序,请安装java-1.8.0-openjdk-devel包。
See herefor more details.
请参阅此处了解更多详情。