当前位置: 首页>>技术教程>>正文


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

, , , ,

问题描述

我有一个64位版本的Ubuntu 13.10。我想运行一个32位版本的程序。但是我看到ia32-libs不包含在13.10中。是否有替换包或这个或什么?

最佳解决方案

不再需要ia32-libs软件包(准确地说是12.04),如果使用APT系统,则无需担心在64位系统中安装32位软件包。这是在引入multiarch之后发生的,这是Debian管理其依赖关系的Debian大多数改变游戏规则之一。此方法允许在同一系统中具有不同的二进制目标,而无需考虑内核体系结构。这并不意味着您可以在没有准备的情况下运行任何32位软件包,但是如果您安装库/二进制文件,理论上应该能够运行任何应用程序。从64位到32位和vice-versa都是如此。

64-bit,package-management,software-installation,32-bit,ubuntu

对于使用此类方法,建议使用APT管理器,以防止未满足的依赖关系。 The changelog包含有关如何进行更改的小历史记录:

  1. In precise the package清空并制成transitional package。它针对尚未移动到multiarch的包添加了几个依赖项。

  2. 慢慢但肯定地,所有软件包都在使用multiarch支持进行重建,并且反向依赖关系被删除或更改为ia32-lib-multiarch。当这些包停止需要ia34-libs包时,同时删除了依赖项。依赖性从ia32-libs变为package:archpackage是所需库的名称,arch是体系结构(下面是skype的例子)。

  3. 使用last release,从pre-raring版本中删除了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 <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系统。

次佳解决方案

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

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

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

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/2008.html,未经允许,请勿转载。