为什么不能 apt-get 安装任何包的 i386 版本?

cha*_*m15 6 apt

为什么不能 apt-get 安装 i386 版本的 libpcap-dev?

$ sudo apt-get install libpcap-dev:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libpcap-dev:i386 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libpcap-dev:i386' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

但是,该包显然存在:https://launchpad.net/ubuntu/trusty/i386/libpcap-dev. 我在 Ubuntu 14.04 x64 上。

Bra*_*iam 6

这通常是因为您没有启用 multiarch 并更新您的软件包列表。这可以轻松实现:

sudo dpkg --add-architecture i386
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

第一个告诉 dpkg 我们喜欢在我们的系统中支持 i386 二进制文件,APT 查询并开始不仅下载 amd64 包列表而且还下载 i386。我不确定为什么这不是 Ubuntu 中的默认设置(在 Debian 中不是,但 Debian 支持更多架构)但这就是原因。


sai*_*895 1

该包可能存在,但该包是一个独立于体系结构的包(请参阅此处了解源包信息),因为这是一个过渡包,除了安装另一个包之外什么也不做。不需要为每个架构“构建”这样的包。

它安装的包是libpcap0.8-dev(不要问我为什么他们决定在开发包后加上版本),它是多架构的。