dpkg-query.1 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. .TH dpkg\-query 1 "2010-03-07" "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.
  71. .TP
  72. .BR \-L ", " \-\-listfiles " \fIpackage-name\fP..."
  73. List files installed to your system from \fIpackage-name\fP.
  74. However, note that files created by package-specific
  75. installation-scripts are not listed.
  76. .TP
  77. .BR \-c ", " \-\-control\-path " \fIpackage-name\fP [\fIcontrol-file\fP]"
  78. List paths for control files installed to your system from \fIpackage-name\fP.
  79. If \fIcontrol-file\fP is specified then only list the path for that control
  80. file if it is present. \fBWarning\fP: this command is semi-public, it should
  81. be used only as a last resort solution, and if no other interface is
  82. available. It might get deprecated later on if better interfaces or the
  83. current architectural deficiencies have been solved.
  84. .TP
  85. .BR \-S ", " \-\-search " \fIfilename-search-pattern\fP..."
  86. Search for a filename from installed packages. All standard shell
  87. wildchars can be used in the pattern. This command will not list
  88. extra files created by maintainer scripts, nor will it list
  89. alternatives.
  90. .TP
  91. .BR \-p ", " \-\-print\-avail " \fIpackage-name\fP..."
  92. Display details about \fIpackage-name\fP, as found in
  93. \fI/var/lib/dpkg/available\fP. Users of APT-based frontends
  94. should use \fBapt\-cache show\fP \fIpackage-name\fP instead
  95. as the \fIavailable\fP file is only kept up-to-date when
  96. using \fBdselect\fP.
  97. .TP
  98. .BR \-h ", " \-\-help
  99. Show the usage message and exit.
  100. .TP
  101. .B \-\-version
  102. Show the version and exit.
  103. .
  104. .SH OPTIONS
  105. .TP
  106. .BI \-\-admindir= dir
  107. Change the location of the \fBdpkg\fR database. The default location is
  108. \fI/var/lib/dpkg\fP.
  109. .TP
  110. .BR \-f ", " \-\-showformat=\fIformat\fR
  111. This option is used to specify the format of the output \fB\-\-show\fP
  112. will produce. The format is a string that will be output for each package
  113. listed.
  114. In the format string, \(lq\fB\e\fP\(rq introduces escapes:
  115. .nf
  116. \fB\en\fP newline
  117. \fB\er\fP carriage return
  118. \fB\et\fP tab
  119. .fi
  120. \(lq\fB\e\fP\(rq before any other character suppresses any special
  121. meaning of the following character, which is useful for \(lq\fB\e\fP\(rq
  122. and \(lq\fB$\fP\(rq.
  123. Package information can be included by inserting
  124. variable references to package fields using the syntax
  125. \(lq\fB${\fP\fIfield\fR[\fB;\fP\fIwidth\fR]\fB}\fP\(rq. Fields are
  126. printed right-aligned unless the width is negative in which case left
  127. alignment will be used. The following \fIfield\fRs are recognised but
  128. they are not necessarily available in the status file (only internal
  129. fields or fields stored in the binary package end up in it):
  130. .nf
  131. \fBArchitecture\fP
  132. \fBBugs\fP
  133. \fBConffiles\fP (internal)
  134. \fBConfig\-Version\fP (internal)
  135. \fBConflicts\fP
  136. \fBBreaks\fP
  137. \fBDepends\fP
  138. \fBDescription\fP
  139. \fBEnhances\fP
  140. \fBEssential\fP
  141. \fBFilename\fP (internal, dselect related)
  142. \fBHomepage\fP
  143. \fBInstalled\-Size\fP
  144. \fBMD5sum\fP (internal, dselect related)
  145. \fBMSDOS\-Filename\fP (internal, dselect related)
  146. \fBMaintainer\fP
  147. \fBOrigin\fP
  148. \fBPackage\fP
  149. \fBPre\-Depends\fP
  150. \fBPriority\fP
  151. \fBProvides\fP
  152. \fBRecommends\fP
  153. \fBReplaces\fP
  154. \fBRevision\fP (obsolete)
  155. \fBSection\fP
  156. \fBSize\fP (internal, dselect related)
  157. \fBSource\fP
  158. \fBStatus\fP (internal)
  159. \fBSuggests\fP
  160. \fBTag\fP (usually not in the .deb but in APT's Packages files)
  161. \fBTriggers-Awaited\fP (internal)
  162. \fBTriggers-Pending\fP (internal)
  163. \fBVersion\fP
  164. .fi
  165. The default format string is \(lq\fB${Package}\et${Version}\en\fP\(rq.
  166. Actually, all other fields found in the status file (i.e. user defined
  167. fields) can be requested, too. They will be printed as-is, though, no
  168. conversion nor error checking is done on them.
  169. To get the name of the dpkg maintainer and the installed version, you could
  170. run:
  171. .nf
  172. \fBdpkg\-query \-W \-f=\(aq${Package} ${Version}\\t${Maintainer}\\n\(aq dpkg\fP
  173. .fi
  174. .
  175. .SH "EXIT STATUS"
  176. .IP 0
  177. The requested query was successfully performed.
  178. .IP 1
  179. Problems were encountered while parsing the command line or performing the
  180. query, including no file or package being found (except for \-\-control\-path).
  181. .
  182. .SH ENVIRONMENT
  183. .TP
  184. \fBCOLUMNS\fP
  185. This setting influences the output of the \fB\-\-list\fP option by changing
  186. the width of its output.
  187. .
  188. .SH AUTHOR
  189. Copyright \(co 2001 Wichert Akkerman
  190. .sp
  191. This is free software; see the GNU General Public Licence version 2 or
  192. later for copying conditions. There is NO WARRANTY.
  193. .
  194. .SH SEE ALSO
  195. .BR dpkg (1).