OS Manuals

/usr/bin/dpkg-query

The Debian Package Manager

From dpkg 1.23.11-r3 (os), captured 2026-11-05 by running dpkg-query --help (exit 0). permalink

Usage: dpkg-query [<option>...] <command>

Commands:
  -s, --status [<package>...]
          Show package metadata information.
  -W, --show [<pattern>...]
          Show package metadata information, with specified format.
  -l, --list [<pattern>...]
          List packages concisely.
  -L, --listfiles <package>...
          List files 'owned' by packages.
  -S, --search <pattern>...
          Find packages owning files.
  -p, --print-avail [<package>...]
          Show available package version information.
      --control-list <package>
          List the package metadata control files.
      --control-show <package> <file>
          Show the package metadata control file.
  -c, --control-path <package> [<file>]
          Print path for package control file.
  -?, --help
          Show this help message.
      --version
          Show the version.

Options:
  -f, --showformat=<format>
          Use alternative format for --show.
          [default: ${binary:Package}\t${Version}\n]
      --load-avail
          Use available file on --show and --list.
      --no-pager
          Disables the use of any pager.
      --admindir=<directory>
          Change the database directory.
          [default: /var/lib/dpkg]
          [env: DPKG_ADMINDIR=]
      --root=<directory>
          Change the root directory.
          [default: /]
          [env: DPKG_ROOT=]

Format syntax:
  A format is a string that will be output for each package. The format
  can include the standard escape sequences \n (newline), \r (carriage
  return) or \\ (plain backslash). Package information can be included
  by inserting variable references to package fields using the ${var[;width]}
  syntax. Fields will be right-aligned unless the width is negative in which
  case left alignment will be used.
Options (14)
OptionDescriptionSource
-s, --status package>...Show package metadata information.help
-W, --show pattern>...Show package metadata information, with specified format.help
-l, --list pattern>...List packages concisely.help
-L, --listfiles package>...List files 'owned' by packages.help
-S, --search pattern>...Find packages owning files.help
-p, --print-avail package>...Show available package version information.help
--control-list packageList the package metadata control files.help
-?, --helpShow this help message.help
--versionShow the version.help
-f, --showformat formatThis option is used to specify the format of the output --show will produce.help + man
--load-availAlso load the available file when using the --show and --list commands, which now default to only querying the status file.help + man
--no-pagerDisables the use of any pager when showing information.help + man
--admindir directoryChange the location of the dpkg database.help + man
--root directorySet the root directory to directory, which sets the administrative directory to «directory/var/lib/dpkg».help + man
Exit status (3) from the manual page
0The requested query was successfully performed.
1The requested query failed either fully or partially, due to no file or package being found (except for --control-path, --control-list and --control-show were such errors are fatal).
2Fatal or unrecoverable error due to invalid command-line usage, or interactions with the system, such as accesses to the database, memory allocations, etc.

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.