dpkg-query.1 7.1 KB

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