Warum listet dpkg-query -l mit einem Platzhalter nicht alle möglichen Pakete auf?

Warum listet dpkg-query -l mit einem Platzhalter nicht alle möglichen Pakete auf?

Laut dpkg-queryHandbuchseite:

Dies listet beispielsweise alle Paketnamen auf, die mit „libc6“ beginnen:

            dpkg-query -l 'libc6*'

Wenn ich es unter Debian 10.5 versuche:

$ dpkg-query -l 'libc6*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  libc6:amd64    2.28-10      amd64        GNU C Library: Shared libraries
un  libc6-amd64    <none>       <none>       (no description available)
un  libc6.1        <none>       <none>       (no description available)

Während aptweitere Pakete angezeigt werden:

$ apt list 'libc6*'
Listing... Виконано
libc6-amd64-cross/stable 2.28-7cross1 all
libc6-amd64-i386-cross/stable 2.28-7cross1 all
libc6-amd64-x32-cross/stable 2.28-7cross1 all
libc6-arm64-cross/stable 2.28-7cross1 all
libc6-armel-cross/stable 2.28-7cross1 all
libc6-armhf-cross/stable 2.28-7cross1 all
libc6-dbg/stable 2.28-10 amd64
libc6-dev-amd64-cross/stable 2.28-7cross1 all
libc6-dev-amd64-i386-cross/stable 2.28-7cross1 all
libc6-dev-amd64-x32-cross/stable 2.28-7cross1 all
libc6-dev-arm64-cross/stable 2.28-7cross1 all
libc6-dev-armel-cross/stable 2.28-7cross1 all
libc6-dev-armhf-cross/stable 2.28-7cross1 all
libc6-dev-hppa-cross/stable 2.28-7cross1 all
libc6-dev-i386-amd64-cross/stable 2.28-7cross1 all
libc6-dev-i386-cross/stable 2.28-7cross1 all
libc6-dev-i386-x32-cross/stable 2.28-7cross1 all
libc6-dev-i386/stable 2.28-10 amd64
libc6-dev-m68k-cross/stable 2.28-7cross1 all
libc6-dev-mips-cross/stable 2.28-7cross1 all
libc6-dev-mips32-mips64-cross/stable 2.28-7cross2 all
libc6-dev-mips32-mips64el-cross/stable 2.28-7cross1 all
libc6-dev-mips32-mips64r6-cross/stable 2.28-7cross2 all
libc6-dev-mips32-mips64r6el-cross/stable 2.28-7cross2 all
libc6-dev-mips32-mipsn32-cross/stable 2.28-7cross2 all
libc6-dev-mips32-mipsn32el-cross/stable 2.28-7cross2 all
libc6-dev-mips32-mipsn32r6-cross/stable 2.28-7cross2 all
libc6-dev-mips32-mipsn32r6el-cross/stable 2.28-7cross2 all
libc6-dev-mips64-cross/stable 2.28-7cross2 all
libc6-dev-mips64-mips-cross/stable 2.28-7cross1 all
libc6-dev-mips64-mipsel-cross/stable 2.28-7cross1 all
libc6-dev-mips64-mipsn32-cross/stable 2.28-7cross2 all
libc6-dev-mips64-mipsn32el-cross/stable 2.28-7cross2 all
libc6-dev-mips64-mipsn32r6-cross/stable 2.28-7cross2 all
libc6-dev-mips64-mipsn32r6el-cross/stable 2.28-7cross2 all
libc6-dev-mips64-mipsr6-cross/stable 2.28-7cross2 all
libc6-dev-mips64-mipsr6el-cross/stable 2.28-7cross2 all
libc6-dev-mips64el-cross/stable 2.28-7cross1 all
libc6-dev-mips64r6-cross/stable 2.28-7cross2 all
libc6-dev-mips64r6el-cross/stable 2.28-7cross2 all
libc6-dev-mipsel-cross/stable 2.28-7cross1 all
libc6-dev-mipsn32-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32-mips-cross/stable 2.28-7cross1 all
libc6-dev-mipsn32-mips64-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32-mips64el-cross/stable 2.28-7cross1 all
libc6-dev-mipsn32-mips64r6-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32-mips64r6el-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32-mipsel-cross/stable 2.28-7cross1 all
libc6-dev-mipsn32-mipsr6-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32-mipsr6el-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32el-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32r6-cross/stable 2.28-7cross2 all
libc6-dev-mipsn32r6el-cross/stable 2.28-7cross2 all
libc6-dev-mipsr6-cross/stable 2.28-7cross2 all
libc6-dev-mipsr6el-cross/stable 2.28-7cross2 all
libc6-dev-powerpc-cross/stable 2.28-7cross1 all
libc6-dev-powerpc-ppc64-cross/stable 2.28-7cross1 all
libc6-dev-powerpcspe-cross/stable 2.28-7cross1 all
libc6-dev-ppc64-cross/stable 2.28-7cross1 all
libc6-dev-ppc64-powerpc-cross/stable 2.28-7cross1 all
libc6-dev-ppc64el-cross/stable 2.28-7cross1 all
libc6-dev-riscv64-cross/stable 2.28-7cross1 all
libc6-dev-s390-s390x-cross/stable 2.28-7cross1 all
libc6-dev-s390x-cross/stable 2.28-7cross1 all
libc6-dev-sh4-cross/stable 2.28-7cross1 all
libc6-dev-sparc-sparc64-cross/stable 2.28-7cross1 all
libc6-dev-sparc64-cross/stable 2.28-7cross1 all
libc6-dev-x32-amd64-cross/stable 2.28-7cross1 all
libc6-dev-x32-cross/stable 2.28-7cross1 all
libc6-dev-x32-i386-cross/stable 2.28-7cross1 all
libc6-dev-x32/stable 2.28-10 amd64
libc6-dev/stable 2.28-10 amd64
libc6-hppa-cross/stable 2.28-7cross1 all
libc6-i386-amd64-cross/stable 2.28-7cross1 all
libc6-i386-cross/stable 2.28-7cross1 all
libc6-i386-x32-cross/stable 2.28-7cross1 all
libc6-i386/stable 2.28-10 amd64
libc6-m68k-cross/stable 2.28-7cross1 all
libc6-mips-cross/stable 2.28-7cross1 all
libc6-mips32-mips64-cross/stable 2.28-7cross2 all
libc6-mips32-mips64el-cross/stable 2.28-7cross1 all
libc6-mips32-mips64r6-cross/stable 2.28-7cross2 all
libc6-mips32-mips64r6el-cross/stable 2.28-7cross2 all
libc6-mips32-mipsn32-cross/stable 2.28-7cross2 all
libc6-mips32-mipsn32el-cross/stable 2.28-7cross2 all
libc6-mips32-mipsn32r6-cross/stable 2.28-7cross2 all
libc6-mips32-mipsn32r6el-cross/stable 2.28-7cross2 all
libc6-mips64-cross/stable 2.28-7cross2 all
libc6-mips64-mips-cross/stable 2.28-7cross1 all
libc6-mips64-mipsel-cross/stable 2.28-7cross1 all
libc6-mips64-mipsn32-cross/stable 2.28-7cross2 all
libc6-mips64-mipsn32el-cross/stable 2.28-7cross2 all
libc6-mips64-mipsn32r6-cross/stable 2.28-7cross2 all
libc6-mips64-mipsn32r6el-cross/stable 2.28-7cross2 all
libc6-mips64-mipsr6-cross/stable 2.28-7cross2 all
libc6-mips64-mipsr6el-cross/stable 2.28-7cross2 all
libc6-mips64el-cross/stable 2.28-7cross1 all
libc6-mips64r6-cross/stable 2.28-7cross2 all
libc6-mips64r6el-cross/stable 2.28-7cross2 all
libc6-mipsel-cross/stable 2.28-7cross1 all
libc6-mipsn32-cross/stable 2.28-7cross2 all
libc6-mipsn32-mips-cross/stable 2.28-7cross1 all
libc6-mipsn32-mips64-cross/stable 2.28-7cross2 all
libc6-mipsn32-mips64el-cross/stable 2.28-7cross1 all
libc6-mipsn32-mips64r6-cross/stable 2.28-7cross2 all
libc6-mipsn32-mips64r6el-cross/stable 2.28-7cross2 all
libc6-mipsn32-mipsel-cross/stable 2.28-7cross1 all
libc6-mipsn32-mipsr6-cross/stable 2.28-7cross2 all
libc6-mipsn32-mipsr6el-cross/stable 2.28-7cross2 all
libc6-mipsn32el-cross/stable 2.28-7cross2 all
libc6-mipsn32r6-cross/stable 2.28-7cross2 all
libc6-mipsn32r6el-cross/stable 2.28-7cross2 all
libc6-mipsr6-cross/stable 2.28-7cross2 all
libc6-mipsr6el-cross/stable 2.28-7cross2 all
libc6-pic/stable 2.28-10 amd64
libc6-powerpc-cross/stable 2.28-7cross1 all
libc6-powerpc-ppc64-cross/stable 2.28-7cross1 all
libc6-powerpcspe-cross/stable 2.28-7cross1 all
libc6-ppc64-cross/stable 2.28-7cross1 all
libc6-ppc64-powerpc-cross/stable 2.28-7cross1 all
libc6-ppc64el-cross/stable 2.28-7cross1 all
libc6-riscv64-cross/stable 2.28-7cross1 all
libc6-s390-s390x-cross/stable 2.28-7cross1 all
libc6-s390x-cross/stable 2.28-7cross1 all
libc6-sh4-cross/stable 2.28-7cross1 all
libc6-sparc-sparc64-cross/stable 2.28-7cross1 all
libc6-sparc64-cross/stable 2.28-7cross1 all
libc6-x32-amd64-cross/stable 2.28-7cross1 all
libc6-x32-cross/stable 2.28-7cross1 all
libc6-x32-i386-cross/stable 2.28-7cross1 all
libc6-x32/stable 2.28-10 amd64
libc6.1-alpha-cross/stable 2.28-7cross1 all
libc6.1-dev-alpha-cross/stable 2.28-7cross1 all
libc6/stable,now 2.28-10 amd64 [installed]

Wie kann ich dpkg-queryalle Übereinstimmungen anzeigen? Warum wird nur eine Auswahl angezeigt?

Antwort1

dpkg-query/var/lib/dpkg/statuswird standardmäßig nur angezeigt und enthält nur Informationen zu Paketen, die aktuell installiert sind oder in der Vergangenheit installiert waren.

Um alle verfügbaren Pakete anzuzeigen, können Sie die --load-availOption hinzufügen:

dpkg-query --load-avail -l 'libc6*'

Dies setzt jedoch die /var/lib/dpkg/availableAktualität voraus. aptrührt diese Datei nicht an, sondern verwendet seine eigenen Datenbanken. Sie müssen sich also selbst darum kümmern:

for file in /var/lib/apt/lists/*_Packages; do sudo dpkg --merge-avail $file; done

(Beachten Sie, dass übersetzte Beschreibungen hierbei nicht berücksichtigt werden und daher dpkg-querynicht angezeigt werden können.)

aptFür solche Abfragen empfiehlt sich die Verwendung . dpkgverfügt über eine lokale Ansicht von Paketen und apteine repository-basierte Ansicht; repository-basierte Abfragen lassen sich daher besser mit verarbeiten apt.

verwandte Informationen