dpkg-query.1 4.7 KB

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