![Debian:“dpkg -l”名称字段有时包含 arch/abi,有时不包含。为什么?](https://linux22.com/image/205868/Debian%EF%BC%9A%E2%80%9Cdpkg%20-l%E2%80%9D%E5%90%8D%E7%A7%B0%E5%AD%97%E6%AE%B5%E6%9C%89%E6%97%B6%E5%8C%85%E5%90%AB%20arch%2Fabi%EF%BC%8C%E6%9C%89%E6%97%B6%E4%B8%8D%E5%8C%85%E5%90%AB%E3%80%82%E4%B8%BA%E4%BB%80%E4%B9%88%EF%BC%9F.png)
dpkg -l
最近的 Debian bullseye (v11.3) 机器上的(已修剪)输出:
SE Name Version Arch Description
ii bind9-host 1:9.16.27-1~deb11u1 amd64 DNS Lookup Utility
ii bind9-libs:amd64 1:9.16.27-1~deb11u1 amd64 Shared Libraries used by BIND 9
^^^^^
问题:为什么bind9-libs包的名称字段显示架构/abi,而bind9-host的名称字段不显示架构/abi?
前言:
$ dpkg --print-architecture
amd64
$ grep -A6 "Package: bind9-host" /var/lib/dpkg/status
Package: bind9-host
Status: install ok installed
Priority: standard
Section: net
Installed-Size: 376
Maintainer: Debian DNS Team <[email protected]>
Architecture: amd64
$ grep -A6 "Package: bind9-libs" /var/lib/dpkg/status
Package: bind9-libs
Status: install ok installed
Priority: standard
Section: libs
Installed-Size: 3734
Maintainer: Debian DNS Team <[email protected]>
Architecture: amd64
答案1
再添加一行将显示相关字段:
$ grep -A7 "Package: bind9-libs" /var/lib/dpkg/status
Package: bind9-libs
Status: install ok installed
Priority: standard
Section: libs
Installed-Size: 3734
Maintainer: Debian DNS Team <[email protected]>
Architecture: amd64
Multi-Arch: same
bind9-libs
被标记为“Multi-Arch:相同”,这意味着它可以针对多种架构共同安装(例如 amd64
和i386
)。对于具有此属性的包,dpkg
显示体系结构以及包名称。
bind9-hosts
没有这样标记,因此它不可共同安装,并且只能出现在一种体系结构中。