dpkg-query
TLDR
List all installed packages
$ dpkg-query -l
List packages matching pattern$ dpkg-query -l '[libc6*]'
List files installed by a package$ dpkg-query -L [libc6]
Show package information$ dpkg-query -s [libc6]
Search for packages owning files$ dpkg-query -S [/etc/ld.so.conf.d]
SYNOPSIS
dpkg-query action [options] [pattern|package]
DESCRIPTION
dpkg-query queries the dpkg database for information about installed packages. It can list packages, show their status, list files they contain, or find which package owns a file.
PARAMETERS
-l, --list [pattern]
List packages matching pattern-L, --listfiles package
List files installed by package-s, --status package
Show package status and information-S, --search pattern
Find packages owning files matching pattern-W, --show package
Show package in specified format-f, --showformat format
Custom output format
CAVEATS
Only queries installed packages, not repositories. Pattern uses shell glob syntax, not regex. Part of dpkg package.


