1dpkg-query(1) dpkg suite dpkg-query(1)
2
3
4
6 dpkg-query - a tool to query the dpkg database
7
9 dpkg-query [option...] command
10
12 dpkg-query is a tool to show information about packages listed in the
13 dpkg database.
14
16 -l, --list package-name-pattern...
17 List packages matching given pattern. If no package-name-pattern
18 is given, list all packages in /var/lib/dpkg/status, excluding
19 the ones marked as not-installed (i.e. those which have been
20 previously purged). Normal shell wildchars are allowed in pack‐
21 age-name-pattern. Please note you will probably have to quote
22 package-name-pattern to prevent the shell from performing file‐
23 name expansion. For example this will list all package names
24 starting with “libc6”:
25
26 dpkg-query -l 'libc6*'
27
28 The output format of this option is not configurable, but varies
29 automatically to fit the terminal width. It is intended for
30 human readers, and is not easily machine-readable. See -W
31 (--show) and --showformat for a way to configure the output for‐
32 mat.
33
34 -W, --show package-name-pattern...
35 Just like the --list option this will list all packages matching
36 the given pattern. However the output can be customized using
37 the --showformat option. The default output format gives one
38 line per matching package, each line having the name and
39 installed version of the package, separated by a tab.
40
41 -s, --status package-name...
42 Report status of specified package. This just displays the entry
43 in the installed package status database.
44
45 -L, --listfiles package-name...
46 List files installed to your system from package-name. However,
47 note that files created by package-specific installation-scripts
48 are not listed.
49
50 -c, --control-path package-name [control-file]
51 List paths for control files installed to your system from pack‐
52 age-name. If control-file is specified then only list the path
53 for that control file if it is present. Warning: this command is
54 semi-public, it should be used only as a last resort solution,
55 and if no other interface is available. It might get deprecated
56 later on if better interfaces or the current architectural defi‐
57 ciencies have been solved.
58
59 -S, --search filename-search-pattern...
60 Search for a filename from installed packages. All standard
61 shell wildchars can be used in the pattern. This command will
62 not list extra files created by maintainer scripts, nor will it
63 list alternatives.
64
65 -p, --print-avail package-name...
66 Display details about package-name, as found in
67 /var/lib/dpkg/available. Users of APT-based frontends should use
68 apt-cache show package-name instead as the available file is
69 only kept up-to-date when using dselect.
70
71 -h, --help
72 Show the usage message and exit.
73
74 --version
75 Show the version and exit.
76
77 --license, --licence
78 Show the copyright licensing terms and exit.
79
81 --admindir=dir
82 Change the location of the dpkg database. The default location
83 is /var/lib/dpkg.
84
85 -f, --showformat=format
86 This option is used to specify the format of the output --show
87 will produce. The format is a string that will be output for
88 each package listed.
89
90 In the format string, “\” introduces escapes:
91
92 \n newline
93 \r carriage return
94 \t tab
95
96 “\” before any other character suppresses any special meaning of
97 the following character, which is useful for “\” and “$”.
98
99 Package information can be included by inserting variable refer‐
100 ences to package fields using the syntax “${field[;width]}”.
101 Fields are printed right-aligned unless the width is negative in
102 which case left alignment will be used. The following fields are
103 recognised but they are not necessarily available in the status
104 file (only internal fields or fields stored in the binary pack‐
105 age end up in it):
106
107 Architecture
108 Bugs
109 Conffiles (internal)
110 Config-Version (internal)
111 Conflicts
112 Breaks
113 Depends
114 Description
115 Enhances
116 Essential
117 Filename (internal, dselect related)
118 Homepage
119 Installed-Size
120 MD5sum (internal, dselect related)
121 MSDOS-Filename (internal, dselect related)
122 Maintainer
123 Origin
124 Package
125 Pre-Depends
126 Priority
127 Provides
128 Recommends
129 Replaces
130 Revision (obsolete)
131 Section
132 Size (internal, dselect related)
133 Source
134 Status (internal)
135 Suggests
136 Tag (usually not in the .deb but in APT's Packages files)
137 Triggers-Awaited (internal)
138 Triggers-Pending (internal)
139 Version
140
141 The default format string is “${Package}\t${Version}\n”. Actu‐
142 ally, all other fields found in the status file (i.e. user
143 defined fields) can be requested, too. They will be printed as-
144 is, though, no conversion nor error checking is done on them.
145 To get the name of the dpkg maintainer and the installed ver‐
146 sion, you could run:
147
148 dpkg-query -W -f='${Package} ${Version}\t${Maintainer}\n' dpkg
149
151 COLUMNS
152 This setting influences the output of the --list option by
153 changing the width of its output.
154
156 Copyright © 2001 Wichert Akkerman
157
158 This is free software; see the GNU General Public Licence version 2 or
159 later for copying conditions. There is NO WARRANTY.
160
162 dpkg(1).
163
164
165
166
167Debian Project 2009-09-06 dpkg-query(1)