dpkg-query.1 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. .TH dpkg\-query 1 "2009-09-06" "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 output format of this option is not configurable, but varies
  28. automatically to fit the terminal width. It is intended for human
  29. readers, and is not easily machine-readable. See \fB\-W\fP (\fB\-\-show\fP)
  30. and \fB\-\-showformat\fP for a way to configure the output format.
  31. .TP
  32. .BR \-W ", " \-\-show " \fIpackage-name-pattern\fP..."
  33. Just like the \fB\-\-list\fP option this will list all packages matching
  34. the given pattern. However the output can be customized using the
  35. \fB\-\-showformat\fP option.
  36. The default output format gives one line per matching package, each line
  37. having the name and installed version of the package, separated by a tab.
  38. .TP
  39. .BR \-s ", " \-\-status " \fIpackage-name\fP..."
  40. Report status of specified package. This just displays the entry in
  41. the installed package status database.
  42. .TP
  43. .BR \-L ", " \-\-listfiles " \fIpackage-name\fP..."
  44. List files installed to your system from \fIpackage-name\fP.
  45. However, note that files created by package-specific
  46. installation-scripts are not listed.
  47. .TP
  48. .BR \-c ", " \-\-control\-path " \fIpackage-name\fP [\fIcontrol-file\fP]"
  49. List paths for control files installed to your system from \fIpackage-name\fP.
  50. If \fIcontrol-file\fP is specified then only list the path for that control
  51. file if it is present. \fBWarning\fP: this command is semi-public, it should
  52. be used only as a last resort solution, and if no other interface is
  53. available. It might get deprecated later on if better interfaces or the
  54. current architectural deficiencies have been solved.
  55. .TP
  56. .BR \-S ", " \-\-search " \fIfilename-search-pattern\fP..."
  57. Search for a filename from installed packages. All standard shell
  58. wildchars can be used in the pattern. This command will not list
  59. extra files created by maintainer scripts, nor will it list
  60. alternatives.
  61. .TP
  62. .BR \-p ", " \-\-print\-avail " \fIpackage-name\fP..."
  63. Display details about \fIpackage-name\fP, as found in
  64. \fI/var/lib/dpkg/available\fP. Users of APT-based frontends
  65. should use \fBapt\-cache show\fP \fIpackage-name\fP instead
  66. as the \fIavailable\fP file is only kept up-to-date when
  67. using \fBdselect\fP.
  68. .TP
  69. .BR \-h ", " \-\-help
  70. Show the usage message and exit.
  71. .TP
  72. .B \-\-version
  73. Show the version and exit.
  74. .TP
  75. .BR \-\-license ", " \-\-licence
  76. Show the copyright licensing terms and exit.
  77. .
  78. .SH OPTIONS
  79. .TP
  80. .BI \-\-admindir= dir
  81. Change the location of the \fBdpkg\fR database. The default location is
  82. \fI/var/lib/dpkg\fP.
  83. .TP
  84. .BR \-f ", " \-\-showformat=\fIformat\fR
  85. This option is used to specify the format of the output \fB\-\-show\fP
  86. will produce. The format is a string that will be output for each package
  87. listed.
  88. In the format string, \(lq\fB\e\fP\(rq introduces escapes:
  89. .nf
  90. \fB\en\fP newline
  91. \fB\er\fP carriage return
  92. \fB\et\fP tab
  93. .fi
  94. \(lq\fB\e\fP\(rq before any other character suppresses any special
  95. meaning of the following character, which is useful for \(lq\fB\e\fP\(rq
  96. and \(lq\fB$\fP\(rq.
  97. Package information can be included by inserting
  98. variable references to package fields using the syntax
  99. \(lq\fB${\fP\fIfield\fR[\fB;\fP\fIwidth\fR]\fB}\fP\(rq. Fields are
  100. printed right-aligned unless the width is negative in which case left
  101. alignment will be used. The following \fIfield\fRs are recognised but
  102. they are not necessarily available in the status file (only internal
  103. fields or fields stored in the binary package end up in it):
  104. .nf
  105. \fBArchitecture\fP
  106. \fBBugs\fP
  107. \fBConffiles\fP (internal)
  108. \fBConfig\-Version\fP (internal)
  109. \fBConflicts\fP
  110. \fBBreaks\fP
  111. \fBDepends\fP
  112. \fBDescription\fP
  113. \fBEnhances\fP
  114. \fBEssential\fP
  115. \fBFilename\fP (internal, dselect related)
  116. \fBHomepage\fP
  117. \fBInstalled\-Size\fP
  118. \fBMD5sum\fP (internal, dselect related)
  119. \fBMSDOS\-Filename\fP (internal, dselect related)
  120. \fBMaintainer\fP
  121. \fBOrigin\fP
  122. \fBPackage\fP
  123. \fBPre\-Depends\fP
  124. \fBPriority\fP
  125. \fBProvides\fP
  126. \fBRecommends\fP
  127. \fBReplaces\fP
  128. \fBRevision\fP (obsolete)
  129. \fBSection\fP
  130. \fBSize\fP (internal, dselect related)
  131. \fBSource\fP
  132. \fBStatus\fP (internal)
  133. \fBSuggests\fP
  134. \fBTag\fP (usually not in the .deb but in APT's Packages files)
  135. \fBTriggers-Awaited\fP (internal)
  136. \fBTriggers-Pending\fP (internal)
  137. \fBVersion\fP
  138. .fi
  139. The default format string is \(lq\fB${Package}\et${Version}\en\fP\(rq.
  140. Actually, all other fields found in the status file (i.e. user defined
  141. fields) can be requested, too. They will be printed as-is, though, no
  142. conversion nor error checking is done on them.
  143. To get the name of the dpkg maintainer and the installed version, you could
  144. run:
  145. .nf
  146. \fBdpkg\-query \-W \-f=\(aq${Package} ${Version}\\t${Maintainer}\\n\(aq dpkg\fP
  147. .fi
  148. .
  149. .SH ENVIRONMENT
  150. .TP
  151. \fBCOLUMNS\fP
  152. This setting influences the output of the \fB\-\-list\fP option by changing
  153. the width of its output.
  154. .
  155. .SH AUTHOR
  156. Copyright \(co 2001 Wichert Akkerman
  157. .sp
  158. This is free software; see the GNU General Public Licence version 2 or
  159. later for copying conditions. There is NO WARRANTY.
  160. .
  161. .SH SEE ALSO
  162. .BR dpkg (1).