6

(trimmed) dpkg -l output on a recent debian bullseye (v11.3) machine:

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
               ^^^^^

Question: why does the name field for the bind9-libs package show the architecture/abi whereas the name field for the bind9-host does not show the architecture/abi?

FWIW:

$ 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 <team+dns@tracker.debian.org>
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 <team+dns@tracker.debian.org>
Architecture: amd64
1
  • 1
    Related: for installed packages, dpkg -s bind9-libs would be less error-prone for getting that inormation. Or, if you insist on manually parsing /var/lib/dpkg/status, then something like awk '/Package: bind9-libs/, /^$/ { print }' /var/lib/dpkg/status would show correct number of lines, instead of arbirary (and wrong) grep -A6. May 18 at 23:44

1 Answer 1

9

Adding one more line would reveal the relevant field:

$ 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 <team+dns@tracker.debian.org>
Architecture: amd64
Multi-Arch: same

bind9-libs is marked “Multi-Arch: same”, which means it can be co-installed for multiple architectures (e.g. amd64 and i386). For packages with this property, dpkg shows the architecture along with the package name.

bind9-hosts isn’t marked as such, therefore it isn’t co-installable and can only ever be present for one architecture.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.