dpkg-query.1 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. .\" dpkg manual page - dpkg-query(1)
  2. .\"
  3. .\" Copyright © 2001 Wichert Akkerman <wakkerma@debian.org>
  4. .\" Copyright © 2006-2007 Frank Lichtenheld <djpig@debian.org>
  5. .\" Copyright © 2006-2012 Guillem Jover <guillem@debian.org>
  6. .\" Copyright © 2008-2011 Raphaël Hertzog <hertzog@debian.org>
  7. .\"
  8. .\" This is free software; you can redistribute it and/or modify
  9. .\" it under the terms of the GNU General Public License as published by
  10. .\" the Free Software Foundation; either version 2 of the License, or
  11. .\" (at your option) any later version.
  12. .\"
  13. .\" This is distributed in the hope that it will be useful,
  14. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. .\" GNU General Public License for more details.
  17. .\"
  18. .\" You should have received a copy of the GNU General Public License
  19. .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. .
  21. .TH dpkg\-query 1 "2012-02-22" "Debian Project" "dpkg suite"
  22. .SH NAME
  23. dpkg\-query \- a tool to query the dpkg database
  24. .
  25. .SH SYNOPSIS
  26. .B dpkg\-query
  27. .RI [ option "...] " command
  28. .
  29. .SH DESCRIPTION
  30. \fBdpkg\-query\fP is a tool to show information about packages listed in
  31. the \fBdpkg\fP database.
  32. .
  33. .SH COMMANDS
  34. .TP
  35. .BR \-l ", " \-\-list " [\fIpackage-name-pattern\fP...]"
  36. List packages matching given pattern. If no \fIpackage-name-pattern\fP
  37. is given, list all packages in \fI/var/lib/dpkg/status\fP, excluding
  38. the ones marked as not-installed (i.e. those which have been previously
  39. purged). Normal shell wildchars are allowed
  40. in \fIpackage-name-pattern\fP. Please note you will probably have to
  41. quote \fIpackage-name-pattern\fP to prevent the shell from performing
  42. filename expansion. For example this will list all package names starting
  43. with \*(lqlibc6\*(rq:
  44. .nf
  45. \fBdpkg\-query \-l \(aqlibc6*\(aq\fP
  46. .fi
  47. The first three columns of the output show the desired action, the package
  48. status, and errors, in that order.
  49. Desired action:
  50. .nf
  51. u = Unknown
  52. i = Install
  53. h = Hold
  54. r = Remove
  55. p = Purge
  56. .fi
  57. Package status:
  58. .nf
  59. n = Not-installed
  60. c = Config-files
  61. H = Half-installed
  62. U = Unpacked
  63. F = Half-configured
  64. W = Triggers-awaiting
  65. t = Triggers-pending
  66. i = Installed
  67. .fi
  68. Error flags:
  69. .nf
  70. <empty> = (none)
  71. R = Reinst-required
  72. .fi
  73. An uppercase status or error letter indicates the package is likely to
  74. cause severe problems. Please refer to \fBdpkg\fP(1) for information
  75. about the above states and flags.
  76. The output format of this option is not configurable, but varies
  77. automatically to fit the terminal width. It is intended for human
  78. readers, and is not easily machine-readable. See \fB\-W\fP (\fB\-\-show\fP)
  79. and \fB\-\-showformat\fP for a way to configure the output format.
  80. .TP
  81. .BR \-W ", " \-\-show " [\fIpackage-name-pattern\fP...]"
  82. Just like the \fB\-\-list\fP option this will list all packages matching
  83. the given pattern. However the output can be customized using the
  84. \fB\-\-showformat\fP option.
  85. The default output format gives one line per matching package, each line
  86. having the name (extended with the architecture qualifier for
  87. \fIMuli\-Arch\fP \fBsame\fP packages) and installed version of the package,
  88. separated by a tab.
  89. .TP
  90. .BR \-s ", " \-\-status " \fIpackage-name\fP..."
  91. Report status of specified package. This just displays the entry in
  92. the installed package status database. When multiple \fIpackage-name\fP
  93. are listed, the requested status entries are separated by an empty line.
  94. .TP
  95. .BR \-L ", " \-\-listfiles " \fIpackage-name\fP..."
  96. List files installed to your system from \fIpackage-name\fP. When multiple
  97. \fIpackage-name\fP are listed, the requested lists of files are separated
  98. by an empty line. However, note that files created by package-specific
  99. installation-scripts are not listed.
  100. .TP
  101. .BR \-c ", " \-\-control\-path " \fIpackage-name\fP [\fIcontrol-file\fP]"
  102. List paths for control files installed to your system from \fIpackage-name\fP.
  103. If \fIcontrol-file\fP is specified then only list the path for that control
  104. file if it is present. \fBWarning\fP: this command is semi-public, it should
  105. be used only as a last resort solution, and if no other interface is
  106. available. It might get deprecated later on if better interfaces or the
  107. current architectural deficiencies have been solved.
  108. .TP
  109. .BR \-S ", " \-\-search " \fIfilename-search-pattern\fP..."
  110. Search for packages that own files corresponding to the given pattern.
  111. Standard shell wildchars can be used in the pattern.
  112. This command will not list extra files created by maintainer scripts,
  113. nor will it list alternatives.
  114. .TP
  115. .BR \-p ", " \-\-print\-avail " \fIpackage-name\fP..."
  116. Display details about \fIpackage-name\fP, as found in
  117. \fI/var/lib/dpkg/available\fP. When multiple \fIpackage-name\fP are
  118. listed, the requested \fIavailable\fP entries are separated by an empty
  119. line.
  120. Users of APT-based frontends
  121. should use \fBapt\-cache show\fP \fIpackage-name\fP instead
  122. as the \fIavailable\fP file is only kept up-to-date when
  123. using \fBdselect\fP.
  124. .TP
  125. .BR \-h ", " \-\-help
  126. Show the usage message and exit.
  127. .TP
  128. .B \-\-version
  129. Show the version and exit.
  130. .
  131. .SH OPTIONS
  132. .TP
  133. .BI \-\-admindir= dir
  134. Change the location of the \fBdpkg\fR database. The default location is
  135. \fI/var/lib/dpkg\fP.
  136. .TP
  137. .B \-\-load\-avail
  138. Also load the available file when using the \fB\-\-show\fP and \fB\-\-list\fP
  139. commands, which now default to only querying the status file.
  140. .TP
  141. .BR \-f ", " \-\-showformat=\fIformat\fR
  142. This option is used to specify the format of the output \fB\-\-show\fP
  143. will produce. The format is a string that will be output for each package
  144. listed.
  145. In the format string, \(lq\fB\e\fP\(rq introduces escapes:
  146. .nf
  147. \fB\en\fP newline
  148. \fB\er\fP carriage return
  149. \fB\et\fP tab
  150. .fi
  151. \(lq\fB\e\fP\(rq before any other character suppresses any special
  152. meaning of the following character, which is useful for \(lq\fB\e\fP\(rq
  153. and \(lq\fB$\fP\(rq.
  154. Package information can be included by inserting
  155. variable references to package fields using the syntax
  156. \(lq\fB${\fP\fIfield\fR[\fB;\fP\fIwidth\fR]\fB}\fP\(rq. Fields are
  157. printed right-aligned unless the width is negative in which case left
  158. alignment will be used. The following \fIfield\fRs are recognised but
  159. they are not necessarily available in the status file (only internal
  160. fields or fields stored in the binary package end up in it):
  161. .nf
  162. \fBArchitecture\fP
  163. \fBBugs\fP
  164. \fBConffiles\fP (internal)
  165. \fBConfig\-Version\fP (internal)
  166. \fBConflicts\fP
  167. \fBBreaks\fP
  168. \fBDepends\fP
  169. \fBDescription\fP
  170. \fBEnhances\fP
  171. \fBEssential\fP
  172. \fBFilename\fP (internal, front-end related)
  173. \fBHomepage\fP
  174. \fBInstalled\-Size\fP
  175. \fBMD5sum\fP (internal, front-end related)
  176. \fBMSDOS\-Filename\fP (internal, front-end related)
  177. \fBMaintainer\fP
  178. \fBOrigin\fP
  179. \fBPackage\fP
  180. \fBPre\-Depends\fP
  181. \fBPriority\fP
  182. \fBProvides\fP
  183. \fBRecommends\fP
  184. \fBReplaces\fP
  185. \fBRevision\fP (obsolete)
  186. \fBSection\fP
  187. \fBSize\fP (internal, front-end related)
  188. \fBSource\fP
  189. \fBStatus\fP (internal)
  190. \fBSuggests\fP
  191. \fBTag\fP (usually not in .deb but in repository Packages files)
  192. \fBTriggers\-Awaited\fP (internal)
  193. \fBTriggers\-Pending\fP (internal)
  194. \fBVersion\fP
  195. .fi
  196. The following are virtual fields, generated by \fBdpkg\-query\fP from
  197. values from other fields (note that these do not use valid names for
  198. fields in control files):
  199. .nf
  200. \fBbinary:Package\fP
  201. \fBbinary:Summary\fP
  202. \fBdb:Status\-Abbrev\fP
  203. \fBsource:Package\fP
  204. \fBsource:Version\fP
  205. .fi
  206. The default format string is \(lq\fB${binary:Package}\et${Version}\en\fP\(rq.
  207. Actually, all other fields found in the status file (i.e. user defined
  208. fields) can be requested, too. They will be printed as-is, though, no
  209. conversion nor error checking is done on them. \fBbinary:Package\fP is
  210. a special field that will print the package name with an architecture
  211. qualifier (like "libc6:amd64") if the package has a \fIMulti\-Arch\fP
  212. field with a value of \fBsame\fP, and as such its name could be ambiguous.
  213. To get the name of the dpkg maintainer and the installed version, you could
  214. run:
  215. .nf
  216. \fBdpkg\-query \-W \-f=\(aq${binary:Package} ${Version}\\t${Maintainer}\\n\(aq dpkg\fP
  217. .fi
  218. .
  219. .SH "EXIT STATUS"
  220. .TP
  221. .B 0
  222. The requested query was successfully performed.
  223. .TP
  224. .B 1
  225. Problems were encountered while parsing the command line or performing the
  226. query, including no file or package being found (except for \-\-control\-path).
  227. .
  228. .SH ENVIRONMENT
  229. .TP
  230. .B DPKG_ADMINDIR
  231. If set and the \fB\-\-admindir\fP option has not been specified, it will
  232. be used as the dpkg data directory.
  233. .TP
  234. \fBCOLUMNS\fP
  235. This setting influences the output of the \fB\-\-list\fP option by changing
  236. the width of its output.
  237. .
  238. .SH SEE ALSO
  239. .BR dpkg (1).