dpkg-query.1 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. .nf
  78. \fB\en\fP newline
  79. \fB\er\fP carriage return
  80. \fB\et\fP tab
  81. .fi
  82. \(lq\fB\e\fP\(rq before any other character suppresses any special
  83. meaning of the following character, which is useful for \(lq\fB\e\fP\(rq
  84. and \(lq\fB$\fP\(rq.
  85. Package information can be included by inserting
  86. variable references to package fields using the syntax
  87. \(lq\fB${\fP\fIfield\fR[\fB;\fP\fIwidth\fR]\fB}\fP\(rq. Fields are
  88. printed right-aligned unless the width is negative in which case left
  89. alignment will be used. The following \fIfield\fRs are recognised:
  90. .nf
  91. \fBArchitecture\fP
  92. \fBBugs\fP
  93. \fBConffiles\fP
  94. \fBConfig\-Version\fP
  95. \fBConflicts\fP
  96. \fBBreaks\fP
  97. \fBDepends\fP
  98. \fBDescription\fP
  99. \fBEnhances\fP
  100. \fBEssential\fP
  101. \fBFilename\fP
  102. \fBHomepage\fP
  103. \fBInstalled\-Size\fP
  104. \fBMD5sum\fP
  105. \fBMSDOS\-Filename\fP
  106. \fBMaintainer\fP
  107. \fBOrigin\fP
  108. \fBPackage\fP
  109. \fBPre\-Depends\fP
  110. \fBPriority\fP
  111. \fBProvides\fP
  112. \fBRecommends\fP
  113. \fBReplaces\fP
  114. \fBRevision\fP
  115. \fBSection\fP
  116. \fBSize\fP
  117. \fBSource\fP
  118. \fBStatus\fP
  119. \fBSuggests\fP
  120. \fBTag\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. .nf
  130. \fBdpkg\-query \-W \-f=\(aq${Package} ${Version}\\t${Maintainer}\\n\(aq dpkg\fP
  131. .fi
  132. .
  133. .SH ENVIRONMENT
  134. .TP
  135. \fBCOLUMNS\fP
  136. This setting influences the output of the \fB\-\-list\fP option by changing
  137. the width of its output.
  138. .
  139. .SH AUTHOR
  140. Copyright (C) 2001 Wichert Akkerman
  141. .sp
  142. This is free software; see the GNU General Public Licence version 2 or
  143. later for copying conditions. There is NO WARRANTY.
  144. .
  145. .SH SEE ALSO
  146. .BR dpkg (1).