dpkg-query.1 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. .TH dpkg\-query 1 "2007-03-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 with state purge. Normal shell wildchars are allowed
  19. in \fIpackage-name-pattern\fP. Please note you will probably have to
  20. quote \fIpackage-name-pattern\fP to prevent the shell from performing
  21. filename expansion. For example this will list all package names starting
  22. with \*(lqlibc6\*(rq:
  23. .T
  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 \fBpackage-name\fP.
  45. However, note that files created by package-specific
  46. installation-scripts are not listed.
  47. .TP
  48. .BR \-S ", " \-\-search " \fIfilename-search-pattern\fP ..."
  49. Search for a filename from installed packages. All standard shell
  50. wildchars can be used in the pattern. This command will not list
  51. extra files created by maintainer scripts, nor will it list
  52. alternatives.
  53. .TP
  54. .BR \-p ", " \-\-print\-avail " \fIpackage-name\fP"
  55. Display details about \fIpackage-name\fP, as found in
  56. \fI/var/lib/dpkg/available\fP.
  57. .TP
  58. .BR \-h ", " \-\-help
  59. Show the usage message and exit.
  60. .TP
  61. .B \-\-version
  62. Show the version and exit.
  63. .TP
  64. .BR \-\-license ", " \-\-licence
  65. Show the copyright licensing terms and exit.
  66. .
  67. .SH OPTIONS
  68. .TP
  69. .BI \-\-admindir= dir
  70. Change the location of the \fBdpkg\fR database. The default location is
  71. \fI/var/lib/dpkg\fP.
  72. .TP
  73. .BR \-f ", " \-\-showformat=\fIformat\fR
  74. This option is used to specify the format of the output \fB\-\-show\fP
  75. will produce. The format is a string that will be output for each package
  76. listed.
  77. In the format string, \(lq\fB\e\fP\(rq introduces escapes:
  78. .T
  79. .nf
  80. \fB\en\fP newline
  81. \fB\er\fP carriage return
  82. \fB\et\fP tab
  83. .fi
  84. \(lq\fB\e\fP\(rq before any other character suppresses any special
  85. meaning of the following character, which is useful for \(lq\fB\e\fP\(rq
  86. and \(lq\fB$\fP\(rq.
  87. Package information can be included by inserting
  88. variable references to package fields using the syntax
  89. \(lq\fB${\fP\fIfield\fR[\fB;\fP\fIwidth\fR]\fB}\fP\(rq. Fields are
  90. printed right-aligned unless the width is negative in which case left
  91. alignment will be used. The following \fIfield\fRs are recognised:
  92. .T
  93. .nf
  94. \fBArchitecture\fP
  95. \fBBugs\fP
  96. \fBConffiles\fP
  97. \fBConfig\-Version\fP
  98. \fBConflicts\fP
  99. \fBDepends\fP
  100. \fBDescription\fP
  101. \fBEnhances\fP
  102. \fBEssential\fP
  103. \fBFilename\fP
  104. \fBInstalled\-Size\fP
  105. \fBMD5sum\fP
  106. \fBMSDOS\-Filename\fP
  107. \fBMaintainer\fP
  108. \fBOrigin\fP
  109. \fBPackage\fP
  110. \fBPre\-Depends\fP
  111. \fBPriority\fP
  112. \fBProvides\fP
  113. \fBRecommends\fP
  114. \fBReplaces\fP
  115. \fBRevision\fP
  116. \fBSection\fP
  117. \fBSize\fP
  118. \fBSource\fP
  119. \fBStatus\fP
  120. \fBSuggests\fP
  121. \fBVersion\fP
  122. .fi
  123. The default format string is \(lq\fB${Package}\et${Version}\en\fP\(rq.
  124. Actually, all other fields found in the status file (i.e. user defined
  125. fields) can be requested, too. They will be printed as-is, though, no
  126. conversion nor error checking is done on them.
  127. To get the name of the dpkg maintainer and the installed version, you could
  128. run:
  129. .T
  130. .nf
  131. \fBdpkg\-query \-W \-f='${Package} ${Version}\\t${Maintainer}\\n' dpkg\fP
  132. .fi
  133. .
  134. .SH ENVIRONMENT
  135. .TP
  136. \fBCOLUMNS\fP
  137. This setting influences the output of the \fB\-\-list\fP option by changing
  138. the width of its output.
  139. .
  140. .SH AUTHOR
  141. Copyright 2001 Wichert Akkerman
  142. .UR mailto:wakkerma@debian.org
  143. <wakkerma@debian.org>
  144. .UE
  145. .sp
  146. This is free software; see the GNU General Public Licence version 2 or
  147. later for copying conditions. There is NO warranty.
  148. .
  149. .SH SEE ALSO
  150. .BR dpkg (1).