dpkg-query man page on ElementaryOS

Man page or keyword search:  
man Server   4994 pages
apropos Keyword Search (all sections)
Output format
ElementaryOS logo
[printable version]

dpkg-query(1)			  dpkg suite			 dpkg-query(1)

       dpkg-query - a tool to query the dpkg database

       dpkg-query [option...] command

       dpkg-query  is  a tool to show information about packages listed in the
       dpkg database.

       -l, --list [package-name-pattern...]
	      List packages matching given pattern. If no package-name-pattern
	      is  given,  list all packages in /var/lib/dpkg/status, excluding
	      the ones marked as not-installed (i.e.  those  which  have  been
	      previously  purged). Normal shell wildchars are allowed in pack‐
	      age-name-pattern. Please note you will probably  have  to	 quote
	      package-name-pattern  to prevent the shell from performing file‐
	      name expansion. For example this will  list  all	package	 names
	      starting with “libc6”:

		dpkg-query -l 'libc6*'

	      The  first  three columns of the output show the desired action,
	      the package status, and errors, in that order.

	      Desired action:
		u = Unknown
		i = Install
		h = Hold
		r = Remove
		p = Purge

	      Package status:
		n = Not-installed
		c = Config-files
		H = Half-installed
		U = Unpacked
		F = Half-configured
		W = Triggers-awaiting
		t = Triggers-pending
		i = Installed

	      Error flags:
		<empty> = (none)
		R = Reinst-required

	      An uppercase status or error letter  indicates  the  package  is
	      likely  to  cause	 severe	 problems. Please refer to dpkg(1) for
	      information about the above states and flags.

	      The output format of this option is not configurable, but varies
	      automatically  to	 fit  the  terminal  width. It is intended for
	      human readers,  and  is  not  easily  machine-readable.  See  -W
	      (--show) and --showformat for a way to configure the output for‐

       -W, --show [package-name-pattern...]
	      Just like the --list option this will list all packages matching
	      the  given  pattern.  However the output can be customized using
	      the --showformat option.	The default output  format  gives  one
	      line  per	 matching package, each line having the name (extended
	      with the architecture qualifier for  Multi-Arch  same  packages)
	      and installed version of the package, separated by a tab.

       -s, --status package-name...
	      Report status of specified package. This just displays the entry
	      in the installed package status database. When multiple package-
	      name  are	 listed, the requested status entries are separated by
	      an empty line, with the same order as specified on the  argument

       -L, --listfiles package-name...
	      List files installed to your system from package-name. When mul‐
	      tiple package-name are listed, the requested lists of files  are
	      separated	 by an empty line, with the same order as specified on
	      the argument list.  However, note that files created by package-
	      specific installation-scripts are not listed.

       --control-list package-name
	      List  control  files installed to your system from package-name.
	      These can be used as input arguments to --control-show.

       --control-show package-name control-file
	      Print the control-file installed to your	system	from  package-
	      name to the standard output.

       -c, --control-path package-name [control-file]
	      List paths for control files installed to your system from pack‐
	      age-name.	 If control-file is specified then only list the  path
	      for that control file if it is present. Warning: this command is
	      deprecated, please  switch  to  use  --control-list  and	--con‐
	      trol-show instead.

       -S, --search filename-search-pattern...
	      Search  for  packages  that own files corresponding to the given
	      pattern.	Standard shell wildchars can be used in	 the  pattern.
	      This  command  will  not	list extra files created by maintainer
	      scripts, nor will it list alternatives.

       -p, --print-avail package-name...
	      Display	details	   about    package-name,    as	   found    in
	      /var/lib/dpkg/available.	When multiple package-name are listed,
	      the requested available entries are separated by an empty	 line,
	      with the same order as specified on the argument list.

	      Users  of APT-based frontends should use apt-cache show package-
	      name instead as the available file is only kept up-to-date  when
	      using dselect.

       -?, --help
	      Show the usage message and exit.

	      Show the version and exit.

	      Change  the  location of the dpkg database. The default location
	      is /var/lib/dpkg.

	      Also load the available file when using the  --show  and	--list
	      commands, which now default to only querying the status file.

       -f, --showformat=format
	      This  option  is used to specify the format of the output --show
	      will produce. The format is a string that	 will  be  output  for
	      each package listed.

	      In the format string, “\” introduces escapes:

		  \n  newline
		  \r  carriage return
		  \t  tab

	      “\” before any other character suppresses any special meaning of
	      the following character, which is useful for “\” and “$”.

	      Package information can be included by inserting variable refer‐
	      ences  to	 package  fields  using the syntax “${field[;width]}”.
	      Fields are printed right-aligned unless the width is negative in
	      which case left alignment will be used. The following fields are
	      recognized but they are not necessarily available in the	status
	      file  (only internal fields or fields stored in the binary pack‐
	      age end up in it):

		  Conffiles (internal)
		  Config-Version (internal)
		  Filename (internal, front-end related)
		  MD5sum (internal, front-end related)
		  MSDOS-Filename (internal, front-end related)
		  Revision (obsolete)
		  Size (internal, front-end related)
		  Status (internal)
		  Tag (usually not in .deb but in repository Packages files)
		  Triggers-Awaited (internal)
		  Triggers-Pending (internal)

	      The following are virtual fields, generated by  dpkg-query  from
	      values from other fields (note that these do not use valid names
	      for fields in control files):


	      The default format string is  “${binary:Package}\t${Version}\n”.
	      Actually,	 all  other fields found in the status file (i.e. user
	      defined fields) can be requested, too. They will be printed  as-
	      is,  though,  no	conversion nor error checking is done on them.
	      binary:Package is a special field that will  print  the  package
	      name  with an architecture qualifier (like "libc6:amd64") if the
	      package has a Multi-Arch field with a value of same, and as such
	      its  name could be ambiguous.  To get the name of the dpkg main‐
	      tainer and the installed version, you could run:

		dpkg-query -W -f='${binary:Package} ${Version}\t${Maintainer}\n' dpkg

       0      The requested query was successfully performed.

       1      Problems were encountered while parsing the command line or per‐
	      forming  the  query,  including  no  file or package being found
	      (except for --control-path).

	      If set and the --admindir option has not been specified, it will
	      be used as the dpkg data directory.

	      This  setting  influences	 the  output  of  the --list option by
	      changing the width of its output.


Debian Project			  2012-04-03			 dpkg-query(1)

List of man pages available for ElementaryOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net