CentOS 64 位错误的 ELF 解释器 [英] CentOS 64 bit bad ELF interpreter

查看:32
本文介绍了CentOS 64 位错误的 ELF 解释器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 CentOS 6 64 位版本,我正在尝试在 64 位机器上安装 32 位应用程序并收到此错误:

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: 错误的 ELF 解释器:没有那个文件或目录

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

我是 Linux 新手.我该如何解决?

I'm new to linux. How do I resolve this?

推荐答案

您使用的是 64 位系统,并且没有安装 32 位库支持.

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

(如果您在设置中不使用 sudo,请阅读下面的注释)

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

Fedora/Red Hat 系列中的大多数桌面 Linux 系统:

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

 pkcon install glibc.i686

可能是一些桌面 Debian/Ubuntu 系统?:

Possibly some desktop Debian/Ubuntu systems?:

pkcon install ia32-libs

Fedora 或更新的 Red Hat、CentOS:

Fedora or newer Red Hat, CentOS:

 sudo dnf install glibc.i686

旧版 RHEL、CentOS:

Older RHEL, CentOS:

   sudo yum install glibc.i686

更旧的 RHEL、CentOS:

Even older RHEL, CentOS:

  sudo yum install glibc.i386

Debian 或 Ubuntu:

Debian or Ubuntu:

   sudo apt-get install ia32-libs

应该抓住你需要的(第一个,主要的)库.

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

任何需要安装 glibc.i686glibc.i386 的人也可能会遇到其他库依赖项.要识别提供任意库的包,您可以使用

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

如果您不确定它是否在 /usr/bin 中,您也可以依靠

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

 ldd $(which YOURAPPNAME)

输出将如下所示:

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

检查缺少的库(例如上面输出中的libSM.so.6),对于每个库,您需要找到提供它的包.

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.

Fedora/Red Hat Enterprise/CentOS:

Fedora/Red Hat Enterprise/CentOS:

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

或者,在较旧的 RHEL/CentOS 上:

or, on older RHEL/CentOS:

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

或者,在 Debian/Ubuntu 上:

or, on Debian/Ubuntu:

首先,安装并下载apt-file

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

然后用

 apt-file find libSM.so.6

注意(通常)情况下的前缀路径/usr/lib;很少,由于历史原因,一些库仍然存在于 /lib 下......在典型的 64 位系统上,32 位库存在于 /usr/lib 中,而 64 位库存在于在 /usr/lib64 中.

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 以不同方式组织多架构库.)

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

上面应该给你一个包名,例如:

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

在本例中,包的名称是 libSM包的 32 位版本的名称是 libSM.i686.

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

然后,您可以在 GUI 中使用 pkconsudo dnf/yum/apt-get 安装软件包以获取必要的库....例如 pkcon install libSM.i686.如有必要,您可以完全指定版本.例如 sudo dnf install ibSM-1.2.0-2.fc15.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).

顺便说一下,您面临的问题要么意味着您的 RPM(或 DPkg/DSelect)数据库已损坏,要么您尝试运行的应用程序不是通过包管理器安装的.如果您是 Linux 新手,您可能希望尽可能避免使用包管理器以外来源的软件...

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

类型

su -c

每次看到sudo,例如

su -c dnf install glibc.i686

关于库名中的纪元标志

名称前的纪元"指示符是底层 RPM 库处理版本号方式的产物;例如

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

这里2:可以省略;只需 pkcon install libpng.i686sudo dnf install libpng-1.2.46-1.fc16.i686.(它含糊地暗示:在某些时候,libpng 包的版本号向后滚动,并且必须增加epoch"以确保在此期间较新的版本将被视为较新"更新.或者发生了类似的事情.两次.)

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

更新以更全面地阐明和涵盖各种包管理器选项(2016 年 3 月)

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

这篇关于CentOS 64 位错误的 ELF 解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆