dpkg-query.1 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. .TH dpkg\-query 1 "2008-08-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 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 \-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. Users of APT-based frontends
  57. should use \fBapt\-cache show\fP \fIpackage-name\fP instead
  58. as the \fIavailable\fP file is only kept up-to-date when
  59. using \fBdselect\fP.
  60. .TP
  61. .BR \-h ", " \-\-help
  62. Show the usage message and exit.
  63. .TP
  64. .B \-\-version
  65. Show the version and exit.
  66. .TP
  67. .BR \-\-license ", " \-\-licence
  68. Show the copyright licensing terms and exit.
  69. .
  70. .SH OPTIONS
  71. .TP
  72. .BI \-\-admindir= dir
  73. Change the location of the \fBdpkg\fR database. The default location is
  74. \fI/var/lib/dpkg\fP.
  75. .TP
  76. .BR \-f ", " \-\-showformat=\fIformat\fR
  77. This option is used to specify the format of the output \fB\-\-show\fP
  78. will produce. The format is a string that will be output for each package
  79. listed.
  80. In the format string, \(lq\fB\e\fP\(rq introduces escapes:
  81. .nf
  82. \fB\en\fP newline
  83. \fB\er\fP carriage return
  84. \fB\et\fP tab
  85. .fi
  86. \(lq\fB\e\fP\(rq before any other character suppresses any special
  87. meaning of the following character, which is useful for \(lq\fB\e\fP\(rq
  88. and \(lq\fB$\fP\(rq.
  89. Package information can be included by inserting
  90. variable references to package fields using the syntax
  91. \(lq\fB${\fP\fIfield\fR[\fB;\fP\fIwidth\fR]\fB}\fP\(rq. Fields are
  92. printed right-aligned unless the width is negative in which case left
  93. alignment will be used. The following \fIfield\fRs are recognised but
  94. they are not necessarily available in the status file (only internal
  95. fields or fields stored in the binary package end up in it):
  96. .nf
  97. \fBArchitecture\fP
  98. \fBBugs\fP
  99. \fBConffiles\fP (internal)
  100. \fBConfig\-Version\fP (internal)
  101. \fBConflicts\fP
  102. \fBBreaks\fP
  103. \fBDepends\fP
  104. \fBDescription\fP
  105. \fBEnhances\fP
  106. \fBEssential\fP
  107. \fBFilename\fP (internal, dselect related)
  108. \fBHomepage\fP
  109. \fBInstalled\-Size\fP
  110. \fBMD5sum\fP (internal, dselect related)
  111. \fBMSDOS\-Filename\fP (internal, dselect related)
  112. \fBMaintainer\fP
  113. \fBOrigin\fP
  114. \fBPackage\fP
  115. \fBPre\-Depends\fP
  116. \fBPriority\fP
  117. \fBProvides\fP
  118. \fBRecommends\fP
  119. \fBReplaces\fP
  120. \fBRevision\fP (obsolete)
  121. \fBSection\fP
  122. \fBSize\fP (internal, dselect related)
  123. \fBSource\fP
  124. \fBStatus\fP (internal)
  125. \fBSuggests\fP
  126. \fBTag\fP (usually not in the .deb but in APT's Packages files)
  127. \fBTriggers-Awaited\fP (internal)
  128. \fBTriggers-Pending\fP (internal)
  129. \fBVersion\fP
  130. .fi
  131. The default format string is \(lq\fB${Package}\et${Version}\en\fP\(rq.
  132. Actually, all other fields found in the status file (i.e. user defined
  133. fields) can be requested, too. They will be printed as-is, though, no
  134. conversion nor error checking is done on them.
  135. To get the name of the dpkg maintainer and the installed version, you could
  136. run:
  137. .nf
  138. \fBdpkg\-query \-W \-f=\(aq${Package} ${Version}\\t${Maintainer}\\n\(aq dpkg\fP
  139. .fi
  140. .
  141. .SH ENVIRONMENT
  142. .TP
  143. \fBCOLUMNS\fP
  144. This setting influences the output of the \fB\-\-list\fP option by changing
  145. the width of its output.
  146. .
  147. .SH AUTHOR
  148. Copyright \(co 2001 Wichert Akkerman
  149. .sp
  150. This is free software; see the GNU General Public Licence version 2 or
  151. later for copying conditions. There is NO WARRANTY.
  152. .
  153. .SH SEE ALSO
  154. .BR dpkg (1).