dpkg-query.1 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. .TH dpkg\-query 1 "2006-04-09" "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. .BR \-l | \-\-list
  8. .IR package-name-pattern " ..."
  9. .br
  10. .B dpkg\-query
  11. .BR \-W | \-\-show
  12. .IR package-name-pattern " ..."
  13. .br
  14. .B dpkg\-query
  15. .BR \-s | \-\-status
  16. .IR package-name " ..."
  17. .br
  18. .B dpkg\-query
  19. .BR \-L | \-\-listfiles
  20. .IR package-name " ..."
  21. .br
  22. .B dpkg\-query
  23. .BR \-S | \-\-search
  24. .IR filename-search-pattern " ..."
  25. .br
  26. .B dpkg\-query
  27. .BR \-p | \-\-print\-avail
  28. .IR package-name " ..."
  29. .br
  30. .B dpkg\-query
  31. .BR \-\-licence | \-\-license
  32. .br
  33. .B dpkg\-query
  34. .BR \-\-version
  35. .
  36. .SH DESCRIPTION
  37. \fBdpkg\-query\fP is a tool to show information about packages listed in
  38. the \fBdpkg\fP database.
  39. .
  40. .SH COMMANDS
  41. .TP
  42. \fB\-l\fP | \fB\-\-list\fP \fIpackage-name-pattern\fP ...
  43. List packages matching given pattern. If no \fIpackage-name-pattern\fP
  44. is given, list all packages in \fI/var/lib/dpkg/status\fP, excluding
  45. the ones marked with state purge. Normal shell wildchars are allowed
  46. in \fIpackage-name-pattern\fP. Please note you will probably have to
  47. quote \fIpackage-name-pattern\fP to prevent the shell from performing
  48. filename expansion. For example this will list all package names starting
  49. with \*(lqlibc6\*(rq:
  50. .T
  51. .nf
  52. \fBdpkg\-query \-l \(aqlibc6*\(aq\fP
  53. .fi
  54. The output format of this option is not configurable, but varies
  55. automatically to fit the terminal width. It is intended for human
  56. readers, and is not easily machine-readable. See \fB\-W\fP (\fB\-\-show\fP)
  57. and \fB\-\-showformat\fP for a way to configure the output format.
  58. .TP
  59. \fB\-W\fP | \fB\-\-show\fP \fIpackage-name-pattern\fP ...
  60. Just like the \fB\-\-list\fP option this will list all packages matching
  61. the given pattern. However the output can be customized using the
  62. \fB\-\-showformat\fP option.
  63. The default output format gives one line per matching package, each line
  64. having the name and installed version of the package, separated by a tab.
  65. .TP
  66. \fB\-s\fP | \fB\-\-status\fP \fIpackage-name\fP ...
  67. Report status of specified package. This just displays the entry in
  68. the installed package status database.
  69. .TP
  70. \fB\-L\fP | \fB\-\-listfiles\fP \fIpackage-name\fP ...
  71. List files installed to your system from \fBpackage-name\fP.
  72. However, note that files created by package-specific
  73. installation-scripts are not listed.
  74. .TP
  75. \fB\-S\fP | \fB\-\-search\fP \fIfilename-search-pattern\fP ...
  76. Search for a filename from installed packages. All standard shell
  77. wildchars can be used in the pattern. This command will not list
  78. extra files created by maintainer scripts, nor will it list
  79. alternatives.
  80. .TP
  81. \fB\-p\fP |\fB\-\-print\-avail\fP \fIpackage-name\fP
  82. Display details about \fIpackage-name\fP, as found in
  83. \fI/var/lib/dpkg/available\fP.
  84. .TP
  85. \fB\-\-licence\fP | \fB\-\-license\fP
  86. Display licence and copyright information.
  87. .TP
  88. \fB\-\-version\fP
  89. Display version information.
  90. .
  91. .SH OPTIONS
  92. .TP
  93. \fB\-\-admindir=\fIdir\fP
  94. Change the location of the \fBdpkg\fR database. The default location is
  95. \fI/var/lib/dpkg\fP.
  96. .TP
  97. \fB-f\fP | \fB\-\-showformat=\fP\fIformat\fR
  98. This option is used to specify the format of the output \fB\-\-show\fP
  99. will produce. The format is a string that will be output for each package
  100. listed.
  101. In the format string, \(lq\fB\e\fP\(rq introduces escapes:
  102. .T
  103. .nf
  104. \fB\en\fP newline
  105. \fB\er\fP carriage return
  106. \fB\et\fP tab
  107. .fi
  108. \(lq\fB\e\fP\(rq before any other character suppresses any special
  109. meaning of the following character, which is useful for \(lq\fB\e\fP\(rq
  110. and \(lq\fB$\fP\(rq.
  111. Package information can be included by inserting
  112. variable references to package fields using the syntax
  113. \(lq\fB${\fP\fIfield\fR[\fB;\fP\fIwidth\fR]\fB}\fP\(rq. Fields are
  114. printed right-aligned unless the width is negative in which case left
  115. alignment will be used. The following \fIfield\fRs are recognised:
  116. .T
  117. .nf
  118. \fBArchitecture\fP
  119. \fBBugs\fP
  120. \fBConffiles\fP
  121. \fBConfig\-Version\fP
  122. \fBConflicts\fP
  123. \fBDepends\fP
  124. \fBDescription\fP
  125. \fBEnhances\fP
  126. \fBEssential\fP
  127. \fBFilename\fP
  128. \fBInstalled\-Size\fP
  129. \fBMD5sum\fP
  130. \fBMSDOS\-Filename\fP
  131. \fBMaintainer\fP
  132. \fBOrigin\fP
  133. \fBPackage\fP
  134. \fBPre\-Depends\fP
  135. \fBPriority\fP
  136. \fBProvides\fP
  137. \fBRecommends\fP
  138. \fBReplaces\fP
  139. \fBRevision\fP
  140. \fBSection\fP
  141. \fBSize\fP
  142. \fBSource\fP
  143. \fBStatus\fP
  144. \fBSuggests\fP
  145. \fBVersion\fP
  146. .fi
  147. The default format string is \(lq\fB${Package}\et${Version}\en\fP\(rq.
  148. Actually, all other fields found in the status file (i.e. user defined
  149. fields) can be requested, too. They will be printed as-is, though, no
  150. conversion nor error checking is done on them.
  151. To get the name of the dpkg maintainer and the installed version, you could
  152. run:
  153. .T
  154. .nf
  155. \fBdpkg\-query \-W \-f='${Package} ${Version}\\t${Maintainer}\\n' dpkg\fP
  156. .fi
  157. .
  158. .SH ENVIRONMENT
  159. .TP
  160. \fBCOLUMNS\fP
  161. This setting influences the output of the \fB\-\-list\fP option by changing
  162. the width of its output.
  163. .
  164. .SH AUTHOR
  165. Copyright 2001 Wichert Akkerman
  166. .UR mailto:wakkerma@debian.org
  167. <wakkerma@debian.org>
  168. .UE
  169. .sp
  170. This is free software; see the GNU General Public Licence version 2 or
  171. later for copying conditions. There is NO warranty.
  172. .
  173. .SH SEE ALSO
  174. .BR dpkg (1).