와일드카드가 포함된 dpkg-query -l이 가능한 모든 패키지를 나열하지 않는 이유는 무엇입니까?

와일드카드가 포함된 dpkg-query -l이 가능한 모든 패키지를 나열하지 않는 이유는 무엇입니까?

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

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.

관련 정보