我想安装 32 位库以在 Ubuntu 14.04.2 LTS 操作系统上运行动态链接代码。
尝试了两个命令,但均不起作用:
命令一:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
lib32bz2-1.0 : PreDepends: libc6-i386 (>= 2.9-18) but it is not going to be installed
lib32ncurses5 : Depends: lib32tinfo5 (= 5.9+20140118-1ubuntu1) but it is not going to be installed
Depends: libc6-i386 (>= 2.4) but it is not going to be installed
lib32z1 : Depends: libc6-i386 (>= 2.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
命令2:
sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0
E: Package 'ia32-libs' has no installation candidate
安装 32 位库的适当命令是什么?
浏览其他帖子,人们告诉我执行上面的 shell 命令来修复错误,但对我来说命令不工作。
我也执行了
sudo dpkg --add-architecture i386
因为其他帖子建议执行它。它似乎也没有帮助。当尝试运行文件时:
./vsim
我得到了错误
bash: ./vsim: No such file or directory
尽管文件“vsim”存在:
vsim: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.4, BuildID[sha1]=31fa816092d910bb32b64ed8ea2a5baa1da6b005, stripped
答案1
根据 Humble Bundle 的这篇文章:https://support.humblebundle.com/hc/en-us/articles/202759400-Installing-32-bit-libs-on-a-64-bit-Linux-system
从 Ubuntu 13.04 开始,ia32-库被替换为lib32z1,这又取决于libc6-i386. 尝试以下命令:
sudo apt-get install libc6-i386 lib32z1
您可能需要或不需要 lib32ncurses5 或 lib32bz2-1.0。
- 如果您确实需要 lib32bz2-1.0,那么一旦您安装了 libc6-i386(使用上述命令),它就应该能够正常安装。
- 如果你确实需要 lib32ncurses5,你还需要安装 lib32tinfo5
您可以按如下方式安装 lib32tinfo5:
sudo apt-get install lib32tinfo5
如果您需要 32 位版本的附加库(该库同时存在 32 位和 64 位版本),则可以使用后缀:i386明确安装 32 位版本的软件包。例如:
sudo apt-get install libasound2-plugins:i386