您如何在64位版本的Ubuntu上运行32位程序?


41

我有64位版本的Ubuntu 13.10。我想运行程序的32位版本。但是我看到ia32-libs不包含在13.10中。有替代包装吗?



@bain这不是重复项。这个问题是关于一般情况的,这是一个特定的问题,更不用说这是较旧的,更好的问题。
赛斯2014年

Braiam的回答真棒!因此,如果要在任何地方复制它,都应该合并。
Mateo

Answers:


30

不再需要该ia32-libs软件包(确切地说是从12.04开始),如果您使用APT系统,则无需担心在64位系统中安装32位软件包。这是自Multiarch推出以来发生的,Multiarch是Debian管理依赖关系的方式中最能改变游戏规则的策略之一。此方法允许在同一系统中具有不同的二进制目标,而无需关心内核体系结构。这并不意味着您无需准备就可以运行任何32位软件包,但是,如果您安装了库/二进制文件,则理论上任何应用程序都应该能够运行。从64位到32位都是如此,反之亦然。

在此处输入图片说明

对于使用这种方法,建议使用APT管理器,以防止未满足的依赖关系。变更日志包含有关更改方式的一小段历史:

  1. 确切地说,包装被清空并制成过渡包装。它为尚未迁移到多体系结构的软件包添加了一些依赖项。
  2. 但可以肯定地,所有软件包都在缓慢且可靠的情况下重建,并且具有多体系结构支持,并且反向依赖关系已被删除或更改为ia32-lib-multiarch。当这些软件包不再需要ia34-libs软件包时,依赖关系将同时删除。的依赖关系,从改变ia32-libspackage:archpackage所需要的库的名称和arch结构(下面有与Skype一个例子)。
  3. 最后一个发行版中,ia32-libs-multiarch软件包已从预先发行的发行版中删除,并且ia32-libs没有发布出来。所有Ubuntu软件包都具有多体系结构功能,您可以在系统中安装不同的体系结构软件包。

现在,当安装需要32位二进制文​​件的软件包时,如果您不注意,您将永远不会知道您正在使用32位软件包,因为软件包管理器会自动提取必要的依赖项:

sudo apt-get --no-install-recommends -q -y install skype
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  libaudio2:i386 libjbig0:i386 liblcms1:i386 libmng1:i386 libqt4-dbus:i386 libqt4-declarative:i386
  libqt4-network:i386 libqt4-opengl:i386 libqt4-script:i386 libqt4-sql:i386 libqt4-xml:i386
  libqt4-xmlpatterns:i386 libqtcore4:i386 libqtgui4:i386 libqtwebkit4:i386 libssl1.0.0:i386 libtiff5:i386
  libxss1:i386 libxv1:i386 skype-bin:i386
Suggested packages:
  nas:i386 liblcms-utils:i386 libqt4-declarative-folderlistmodel:i386 libqt4-declarative-gestures:i386
  libqt4-declarative-particles:i386 libqt4-declarative-shaders:i386 qt4-qmlviewer:i386 libqt4-dev:i386
  libthai0:i386 libicu48:i386 qt4-qtconfig:i386
Recommended packages:
  libqt4-sql-mysql:i386 libqt4-sql-odbc:i386 libqt4-sql-psql:i386 libqt4-sql-sqlite:i386 libcups2:i386
  sni-qt:i386 libasound2-plugins:i386
The following NEW packages will be installed:
  libaudio2:i386 libjbig0:i386 liblcms1:i386 libmng1:i386 libqt4-dbus:i386 libqt4-declarative:i386
  libqt4-network:i386 libqt4-opengl:i386 libqt4-script:i386 libqt4-sql:i386 libqt4-xml:i386
  libqt4-xmlpatterns:i386 libqtcore4:i386 libqtgui4:i386 libqtwebkit4:i386 libssl1.0.0:i386 libtiff5:i386
  libxss1:i386 libxv1:i386 skype skype-bin:i386
0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 33.9 MB/38.2 MB of archives.
After this operation, 118 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package libssl1.0.0:i386.
(Reading database ... 208485 files and directories currently installed.)
Unpacking libssl1.0.0:i386 (from .../libssl1.0.0_1.0.1c-4ubuntu8.1_i386.deb) ...
Selecting previously unselected package libaudio2:i386.
Unpacking libaudio2:i386 (from .../libaudio2_1.9.3-5ubuntu0.13.04.1_i386.deb) ...
Selecting previously unselected package liblcms1:i386.
Unpacking liblcms1:i386 (from .../liblcms1_1.19.dfsg-1.2ubuntu2_i386.deb) ...
Selecting previously unselected package libmng1:i386.
Unpacking libmng1:i386 (from .../libmng1_1.0.10-3build1_i386.deb) ...
Selecting previously unselected package libqtcore4:i386.
Unpacking libqtcore4:i386 (from .../libqtcore4_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-xml:i386.
Unpacking libqt4-xml:i386 (from .../libqt4-xml_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-dbus:i386.
Unpacking libqt4-dbus:i386 (from .../libqt4-dbus_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-network:i386.
Unpacking libqt4-network:i386 (from .../libqt4-network_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-script:i386.
Unpacking libqt4-script:i386 (from .../libqt4-script_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-sql:i386.
Unpacking libqt4-sql:i386 (from .../libqt4-sql_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-xmlpatterns:i386.
Unpacking libqt4-xmlpatterns:i386 (from .../libqt4-xmlpatterns_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libjbig0:i386.
Unpacking libjbig0:i386 (from .../libjbig0_2.0-2ubuntu1_i386.deb) ...
Selecting previously unselected package libtiff5:i386.
Unpacking libtiff5:i386 (from .../libtiff5_4.0.2-4ubuntu2.1_i386.deb) ...
Selecting previously unselected package libqtgui4:i386.
Unpacking libqtgui4:i386 (from .../libqtgui4_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-declarative:i386.
Unpacking libqt4-declarative:i386 (from .../libqt4-declarative_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqt4-opengl:i386.
Unpacking libqt4-opengl:i386 (from .../libqt4-opengl_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
Selecting previously unselected package libqtwebkit4:i386.
Unpacking libqtwebkit4:i386 (from .../libqtwebkit4_2.3.0-0ubuntu2_i386.deb) ...
Selecting previously unselected package libxss1:i386.
Unpacking libxss1:i386 (from .../libxss1_1%3a1.2.2-1_i386.deb) ...
Selecting previously unselected package libxv1:i386.
Unpacking libxv1:i386 (from .../libxv1_2%3a1.0.7-1ubuntu0.13.04.1_i386.deb) ...
Selecting previously unselected package skype-bin.
Unpacking skype-bin (from .../skype-bin_4.2.0.11-0ubuntu0.12.04.2_i386.deb) ...
Selecting previously unselected package skype.
Unpacking skype (from .../skype_4.2.0.11-0ubuntu0.12.04.2_amd64.deb) ...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for hicolor-icon-theme ...
Setting up libssl1.0.0:i386 (1.0.1c-4ubuntu8.1) ...
Setting up libaudio2:i386 (1.9.3-5ubuntu0.13.04.1) ...
Setting up liblcms1:i386 (1.19.dfsg-1.2ubuntu2) ...
Setting up libmng1:i386 (1.0.10-3build1) ...
Setting up libqtcore4:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-xml:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-dbus:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-network:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-script:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-sql:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-xmlpatterns:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libjbig0:i386 (2.0-2ubuntu1) ...
Setting up libtiff5:i386 (4.0.2-4ubuntu2.1) ...
Setting up libxss1:i386 (1:1.2.2-1) ...
Setting up libxv1:i386 (2:1.0.7-1ubuntu0.13.04.1) ...
Setting up libqtgui4:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-declarative:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqt4-opengl:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
Setting up libqtwebkit4:i386 (2.3.0-0ubuntu2) ...
Setting up skype-bin (4.2.0.11-0ubuntu0.12.04.2) ...
Setting up skype (4.2.0.11-0ubuntu0.12.04.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

请注意,Skype是i386软件包。如果我使用apt-get来安装它,那么以后我会避免头痛。

但是有些人喜欢使用.deb软件包,然后自己整理一下,因为它可能会有些混乱。您应该事先手动安装所有依赖项,以免系统因未满足的依赖项而结束。一个dpkg-deb -I有用的命令是因为它显示了软件包的信息:

dpkg-deb -I zynaddsubfx-dssi_2.4.3-3_amd64.deb 
 new debian package, version 2.0.
 size 266936 bytes: control archive=845 bytes.
     917 bytes,    19 lines      control              
     232 bytes,     3 lines      md5sums              
 Package: zynaddsubfx-dssi
 Source: zynaddsubfx
 Version: 2.4.3-3
 Architecture: amd64
 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
 Original-Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
 Installed-Size: 633
 Depends: libasound2 (>= 1.0.16), libc6 (>= 2.15), libgcc1 (>= 1:4.1.1), libjack-jackd2-0 (>= 1.9.5~dfsg-14) | libjack-0.116, libmxml1, libstdc++6 (>= 4.6), zlib1g (>= 1:1.1.4)
[...]

如您所见,它列出了依赖项,因此您只需要sudo apt-get install然后依赖它们即可sudo dpkg -i。同样,最好从存储库中安装软件,而不是下载并使用手动安装dpkg -i

现在,如果您是开发人员,则可以使用apt-get语法安装任何库。只需添加:i386到您要下载的库中,然后完成即可。如果从存储库安装软件,则无需手动执行此操作。

底线:不,ia32-libs如果从存储库安装软件包,则无需安装即可运行32位软件包。如果您正在开发中,请尝试始终使用APT系统。


.bin安装程序可以检查ia32-libs软件包是否安装,该怎么办?据我所知,即使我手动安装了正确的依赖项,.bin仍将无法安装,因为它会搜索ia32-libs软件包。有没有一种“欺骗”安装程序的方式,认为安装了ia32-libs?
Galgalesh 2013年

1
@Galgalesh要求维护者修复他们的东西,他们已经过去了。
Braiam 2013年

删除ia32-libs的唯一问题是当您拥有PlayOnLinux之类的程序时,它们试图使用32位库来运行32位Windows程序。然后,这是一种向后的不兼容性。
AlexLordThorsen 2014年

@Rawrgulmuffins他们必须更改... OpenSUSE和Red Hat已经符合LSB和FHS标准,并且ia32-libs软件包不允许他们轻松地管理要完成的更改,这是每个目录的一个目录建筑。开发人员应该改而遵循多体系结构的介绍,并相应地重新打包其软件包。如果他们最近三年都没有过,那他们就是懒惰。
Braiam 2014年

@Braiam因此,故障是由于LSB和FHS标准破坏了向后兼容性。声明这仅要求开发人员重新包装似乎很愚蠢,尤其是因为这破坏了所有依赖lib32的软件包。
AlexLordThorsen 2014年

12

请记住要添加i386体系结构,否则将无法安装32位软件包:

sudo dpkg --add-architecture i386
sudo apt-get update

检查软件包故障排除指南:https : //help.ubuntu.com/community/PackageManagerTroubleshootingProcedure


上面的两个命令没有为我安装任何32位软件包。我想念什么?
e40 2015年

2
好的,对我来说,我必须执行两个附加命令:apt-get install libc6:i386apt-get install libgtk2.0-0:i386(后者是因为它是GTK应用程序)。
2015年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.