无法使用 apt 安装 i386 软件包(Debian)

无法使用 apt 安装 i386 软件包(Debian)

因此,我的本机架构是 amd64,并且我还添加了 i386 作为外来架构。我遇到了奇怪的 apt 行为。例如,让我们以 libqt4-dbus 包为例。我尝试找出所有可用的包版本:

phargelm@phargelm:~$ sudo apt list libqt4-dbus -a
Listing... Done
libqt4-dbus/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64  [installed]

似乎只有 amd64 版本可用。如果我尝试安装此软件包并明确指定软件包体系结构(i386),则会得到以下信息:

phargelm@phargelm:~$ sudo apt install libqt4-dbus: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:
 libqt4-dbus:i386 : Depends: libqtdbus4:i386 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

另外,我使用 apt-get -f install 没有得到任何结果:

phargelm@phargelm:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

但 aptitude 工作得很好:

phargelm@phargelm:~$ sudo aptitude install libqt4-dbus:i386
The following NEW packages will be installed:
  gcc-4.9-base:i386{a} libc6:i386{a} libc6-i686:i386{a} libdbus-1-3:i386{a} libffi6:i386{a} libgcc1:i386{a} libglib2.0-0:i386{a} libpcre3:i386{a} libqt4-dbus:i386 
  libqt4-xml:i386{a} libqtcore4:i386{a} libqtdbus4:i386{a} libselinux1:i386{a} libstdc++6:i386{a} zlib1g:i386{a} 
0 packages upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.2 MB of archives. After unpacking 27.1 MB will be used.

那么,问题是:为什么 aptitude 可以毫无问题地安装 libqt4-dbus:i386,但 apt 却不能,如何解决?

答案1

答案可以在 aptitude 的输出中看到。简单地说,aptitude 是一个高级工具,它试图为您解决依赖问题。Apt 告诉您这个库需要安装依赖项,而 Aptitude 已经为您完成了此操作,请检查 Aptitude 安装的附加库列表以提出您的请求。如果您手动要求 Apt 安装此列表中的所有内容,则可以通过 Apt 实现此操作。

答案2

您可能需要预先更新您的 aptitude 数据库和已安装的软件包。

# aptitude update
# aptitude safe-upgrade 

答案3

通过从源列表中删除非官方的“dotdeb”存储库并卸载/降级所有软件包至稳定分支,该问题已得到解决。

相关内容