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

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

我有一个 64 位版本的 Ubuntu 13.10。我想运行一个 32 位版本的程序。但是我发现ia32-libs13.10 中不包含 32 位版本。是否有替代软件包?

答案1

不再需要该ia32-libs软件包(确切地说是从 12.04 开始),如果您使用 APT 系统,则无需担心在 64 位系统中安装 32 位软件包。自从引入多架构这是 Debian 管理依赖项方式中最具变革性的政策之一。此方法允许在同一系统中拥有不同的二进制目标,而无需考虑内核架构。这并不意味着您可以在不做任何准备的情况下运行任何 32 位软件包,但如果您安装了库/二进制文件,理论上任何应用程序都应该能够运行。从 64 位到 32 位都是如此,反之亦然。

在此处输入图片描述

对于使用这种方法,建议使用 APT 管理器,以防止未满足的依赖关系。变更日志包括关于如何进行更改的简短历史:

  1. 精确的包装被清空,并做了一个过渡方案。它添加了几个针对尚未移动到多架构的软件包的依赖项。
  2. 慢慢地,但很肯定地,所有软件包都重建了多架构支持,反向依赖项被删除或更改为 ia32-lib-multiarch。当这些软件包不再需要 ia34-libs 软件包时,依赖项也会同时被删除。依赖项从 更改为所需ia32-libs库的名称和架构(下面有一个 skype 示例)。package:archpackagearch
  3. 随着最新发布ia32-libs-multiarch软件包已从预发布版本中删除,并且ia32-libs未发布到 saucy。所有 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 <[email protected]>
 Original-Maintainer: Debian Multimedia Maintainers <[email protected]>
 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到您要下载的库即可。如果您从存储库安装软件,则无需手动执行此操作。

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

答案2

请记住添加 i386 架构,否则您将无法安装 32 位软件包:

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

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

相关内容