在 64 位系统上安装 32 位库,缺少 libz.so.1

在 64 位系统上安装 32 位库,缺少 libz.so.1

我尝试了几种类似问题的答案(123)(另见下文)以获取我需要的库。它仍然不起作用,当我尝试在 64 位系统(Lubuntu 15.10)上运行 32 位软件时,我收到此错误消息:

$ ./aiStarter: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

[1]+  Exit 127                ./aiStarter

这就是我尝试过的:

$ sudo dpkg --add-architecture i386

$ sudo apt-get install libstdc++6:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libc6-i386
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  gcc-5-base:i386 libc6:i386 libgcc1:i386
Suggested packages:
  glibc-doc:i386 locales:i386
The following NEW packages will be installed:
  gcc-5-base:i386 libc6:i386 libgcc1:i386 libstdc++6:i386
0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
Need to get 4 537 kB of archives.
After this operation, 12,0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y    #Answered yes, etc...

$ sudo apt-get install package:i386
Reading package lists... Done    
Building dependency tree       
Reading state information... Done
E: Unable to locate package package

$ sudo apt-get install build-essential:i386
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:
 build-essential:i386 : Depends: gcc:i386 (>= 4:5.2) but it is not going to be installed
                    Depends: g++:i386 (>= 4:5.2) but it is not going to be installed
                    Depends: dpkg-dev:i386 (>= 1.17.11)
E: Unable to correct problems, you have held broken packages.

还尝试找到我真正需要的确切包(不确定这是否是正确的方法):

$ apt-file update
$ sudo apt-file -x search '/libz.so.1$'
E: The cache is empty. You need to run 'apt-file update' first.

我还应该尝试其他方法吗?

答案1

在 64 位环境中安装 32 位依赖项:

sudo apt-get install build-essential gcc-multilib gcc-4.8-multilib g++-multilib g++-4.8-multilib lib32z1 lib32ncurses5 lib32bz2-1.0 libc6-dev libgmp-dev libmpfr-dev libmpc-dev

安装库

sudo dpkg --add-architecture i386

答案2

安装以下内容解决了我的问题:cpp-5:i386gcc:i386和。(我注意到您实际上可以从我的问题的最后一条错误消息中读出一些内容。g++:i386dpkg-dev:i386

答案3

如果您没有使用“sudo”,则尝试查找包含 32 位 libz 的缺失包将会成功。输出包含几种可能性,lib32z1:i386 或 libx32z1:i386 是合理的选择。如果您成功构建了 32 位可执行文件,并且加载已启动,则您显然拥有执行 32 位可执行文件所需的所有其他部分。

相关内容