
dpkg-query
マニュアルページによると:
たとえば、以下に「libc6」で始まるすべてのパッケージ名をリストします。
dpkg-query -l 'libc6*'
Debian 10.5 で試してみると、次のようになります。
$ 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)
より多くのパッケージを表示しながらapt
:
$ 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]
dpkg-query
すべての一致をどのように表示しますか?なぜ1つの選択しか表示されないのですか?
答え1
dpkg-query
デフォルトでは表示され、/var/lib/dpkg/status
現在インストールされているパッケージまたは以前にインストールされたパッケージに関する情報のみが含まれます。
利用可能なすべてのパッケージを表示するには、次の--load-avail
オプションを追加できます。
dpkg-query --load-avail -l 'libc6*'
しかし、これは/var/lib/dpkg/available
時代の流れに依存します。apt
ファイルは触れることなく独自のデータベースを使用するため、直接処理する必要があります。
for file in /var/lib/apt/lists/*_Packages; do sudo dpkg --merge-avail $file; done
(翻訳された説明は考慮されていないためdpkg-query
表示できません。)
apt
これらのクエリに最適です。dpkg
パッケージのローカルビューがあり、apt
ストレージベースのビューがあるため、ストレージベースのクエリは最もよく提供されますapt
。