]>
Commit | Line | Data |
---|---|---|
b2e465d6 AL |
1 | <!-- -*- mode: sgml; mode: fold -*- --> |
2 | <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ | |
3 | ||
4 | <!ENTITY % aptent SYSTEM "apt.ent"> | |
5 | %aptent; | |
6 | ||
7 | ]> | |
8 | ||
9 | <refentry> | |
10 | &apt-docinfo; | |
11 | ||
12 | <refmeta> | |
13 | <refentrytitle>apt-cache</> | |
14 | <manvolnum>8</> | |
15 | </refmeta> | |
16 | ||
17 | <!-- Man page title --> | |
18 | <refnamediv> | |
19 | <refname>apt-cache</> | |
20 | <refpurpose>APT package handling utility -- cache manipulator</> | |
21 | </refnamediv> | |
22 | ||
23 | <!-- Arguments --> | |
24 | <refsynopsisdiv> | |
25 | <cmdsynopsis> | |
09774285 | 26 | <command>apt-cache</> |
03eb0ddc | 27 | <arg><option>-hvsn</></arg> |
b2e465d6 AL |
28 | <arg><option>-o=<replaceable/config string/</></arg> |
29 | <arg><option>-c=<replaceable/file/</></arg> | |
30 | <group choice=req> | |
31 | <arg>add <arg choice="plain" rep="repeat"><replaceable>file</replaceable></arg></arg> | |
32 | <arg>gencaches</> | |
33 | <arg>showpkg <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg> | |
2d425135 | 34 | <arg>showsrc <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg> |
b2e465d6 AL |
35 | <arg>stats</> |
36 | <arg>dump</> | |
37 | <arg>dumpavail</> | |
38 | <arg>unmet</> | |
39 | <arg>search <arg choice="plain"><replaceable>regex</replaceable></arg></arg> | |
40 | <arg>show <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg> | |
b2e465d6 | 41 | <arg>depends <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg> |
eba2b51d | 42 | <arg>rdepends <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg> |
b2e465d6 AL |
43 | <arg>pkgnames <arg choice="plain"><replaceable>prefix</replaceable></arg></arg> |
44 | <arg>dotty <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg> | |
af87ab54 | 45 | <arg>policy <arg choice="plain" rep="repeat"><replaceable>pkgs</replaceable></arg></arg> |
bd3d53ef | 46 | <arg>madison <arg choice="plain" rep="repeat"><replaceable>pkgs</replaceable></arg></arg> |
b2e465d6 AL |
47 | </group> |
48 | </cmdsynopsis> | |
49 | </refsynopsisdiv> | |
50 | ||
51 | <RefSect1><Title>Description</> | |
52 | <para> | |
53 | <command/apt-cache/ performs a variety of operations on APT's package | |
54 | cache. <command/apt-cache/ does not manipulate the state of the system | |
55 | but does provide operations to search and generate interesting output | |
56 | from the package metadata. | |
57 | ||
58 | <para> | |
c26a18b9 | 59 | Unless the <option/-h/, or <option/--help/ option is given, one of the |
09774285 | 60 | commands below must be present. |
b2e465d6 AL |
61 | |
62 | <VariableList> | |
c26a18b9 | 63 | <VarListEntry><Term>add <replaceable/file(s)/</Term> |
b2e465d6 | 64 | <ListItem><Para> |
2d425135 AL |
65 | <literal/add/ adds the named package index files to the package cache. |
66 | This is for debugging only. | |
b2e465d6 AL |
67 | </VarListEntry> |
68 | ||
69 | <VarListEntry><Term>gencaches</Term> | |
70 | <ListItem><Para> | |
0270015f | 71 | <literal/gencaches/ performs the same operation as |
b2e465d6 AL |
72 | <command/apt-get check/. It builds the source and package caches from |
73 | the sources in &sources-list; and from <filename>/var/lib/dpkg/status</>. | |
74 | </VarListEntry> | |
75 | ||
c26a18b9 | 76 | <VarListEntry><Term>showpkg <replaceable/pkg(s)/</Term> |
b2e465d6 AL |
77 | <ListItem><Para> |
78 | <literal/showpkg/ displays information about the packages listed on the | |
79 | command line. Remaining arguments are package names. The available | |
80 | versions and reverse dependencies of each package listed are listed, as | |
81 | well as forward dependencies for each version. Forward (normal) | |
82 | dependencies are those packages upon which the package in question | |
83 | depends; reverse dependencies are those packages that depend upon the | |
84 | package in question. Thus, forward dependencies must be satisfied for a | |
85 | package, but reverse dependencies need not be. | |
86 | For instance, <command>apt-cache showpkg libreadline2</> would produce | |
87 | output similar to the following: | |
88 | ||
89 | <informalexample><programlisting> | |
90 | Package: libreadline2 | |
91 | Versions: 2.1-12(/var/state/apt/lists/foo_Packages), | |
92 | Reverse Depends: | |
93 | libreadlineg2,libreadline2 | |
94 | libreadline2-altdev,libreadline2 | |
95 | Dependencies: | |
96 | 2.1-12 - libc5 (2 5.4.0-0) ncurses3.0 (0 (null)) | |
97 | Provides: | |
98 | 2.1-12 - | |
99 | Reverse Provides: | |
100 | </programlisting></informalexample> | |
101 | ||
102 | <para> | |
ae7a4bf3 AL |
103 | Thus it may be seen that libreadline2, version 2.1-12, depends on libc5 and |
104 | ncurses3.0 which must be installed for libreadline2 to work. | |
b2e465d6 | 105 | In turn, libreadlineg2 and libreadline2-altdev depend on libreadline2. If |
c26a18b9 | 106 | libreadline2 is installed, libc5 and ncurses3.0 (and ldso) must also be |
b2e465d6 AL |
107 | installed; libreadlineg2 and libreadline2-altdev do not have to be |
108 | installed. For the specific meaning of the remainder of the output it | |
109 | is best to consult the apt source code. | |
110 | </VarListEntry> | |
111 | ||
112 | <VarListEntry><Term>stats</Term> | |
113 | <ListItem><Para> | |
114 | <literal/stats/ displays some statistics about the cache. | |
115 | No further arguments are expected. Statistics reported are: | |
116 | <itemizedlist> | |
117 | <listitem><para> | |
118 | <literal/Total package names/ is the number of package names found | |
119 | in the cache. | |
120 | </listitem> | |
121 | ||
122 | <listitem><para> | |
123 | <literal/Normal packages/ is the number of regular, ordinary package | |
124 | names; these are packages that bear a one-to-one correspondence between | |
125 | their names and the names used by other packages for them in | |
126 | dependencies. The majority of packages fall into this category. | |
127 | </listitem> | |
128 | ||
129 | <listitem><para> | |
130 | <literal/Pure virtual packages/ is the number of packages that exist | |
131 | only as a virtual package name; that is, packages only "provide" the | |
132 | virtual package name, and no package actually uses the name. For | |
133 | instance, "mail-transport-agent" in the Debian GNU/Linux system is a | |
134 | pure virtual package; several packages provide "mail-transport-agent", | |
135 | but there is no package named "mail-transport-agent". | |
136 | </listitem> | |
137 | ||
138 | <listitem><para> | |
139 | <literal/Single virtual packages/ is the number of packages with only | |
140 | one package providing a particular virtual package. For example, in the | |
141 | Debian GNU/Linux system, "X11-text-viewer" is a virtual package, but | |
142 | only one package, xless, provides "X11-text-viewer". | |
143 | </listitem> | |
144 | ||
145 | <listitem><para> | |
146 | <literal/Mixed virtual packages/ is the number of packages that either | |
147 | provide a particular virtual package or have the virtual package name | |
148 | as the package name. For instance, in the Debian GNU/Linux system, | |
c26a18b9 | 149 | "debconf" is both an actual package, and provided by the debconf-tiny |
b2e465d6 AL |
150 | package. |
151 | </listitem> | |
152 | ||
153 | <listitem><para> | |
154 | <literal/Missing/ is the number of package names that were referenced in | |
155 | a dependency but were not provided by any package. Missing packages may | |
c26a18b9 | 156 | be in evidence if a full distribution is not accessed, or if a package |
b2e465d6 AL |
157 | (real or virtual) has been dropped from the distribution. Usually they |
158 | are referenced from Conflicts statements. | |
159 | </listitem> | |
160 | ||
161 | <listitem><para> | |
162 | <literal/Total distinct/ versions is the number of package versions | |
163 | found in the cache; this value is therefore at least equal to the | |
164 | number of total package names. If more than one distribution (both | |
165 | "stable" and "unstable", for instance), is being accessed, this value | |
166 | can be considerably larger than the number of total package names. | |
167 | </listitem> | |
168 | ||
169 | <listitem><para> | |
170 | <literal/Total dependencies/ is the number of dependency relationships | |
171 | claimed by all of the packages in the cache. | |
172 | </listitem> | |
173 | </itemizedlist> | |
174 | </VarListEntry> | |
175 | ||
c26a18b9 | 176 | <VarListEntry><Term>showsrc <replaceable/pkg(s)/</Term> |
2d425135 AL |
177 | <ListItem><Para> |
178 | <literal/showsrc/ displays all the source package records that match | |
179 | the given package names. All versions are shown, as well as all | |
180 | records that declare the name to be a Binary. | |
2d425135 AL |
181 | </VarListEntry> |
182 | ||
b2e465d6 AL |
183 | <VarListEntry><Term>dump</Term> |
184 | <ListItem><Para> | |
185 | <literal/dump/ shows a short listing of every package in the cache. It is | |
186 | primarily for debugging. | |
187 | </VarListEntry> | |
188 | ||
189 | <VarListEntry><Term>dumpavail</Term> | |
190 | <ListItem><Para> | |
191 | <literal/dumpavail/ prints out an available list to stdout. This is | |
192 | suitable for use with &dpkg; and is used by the &dselect; method. | |
193 | </VarListEntry> | |
194 | ||
195 | <VarListEntry><Term>unmet</Term> | |
196 | <ListItem><Para> | |
197 | <literal/unmet/ displays a summary of all unmet dependencies in the | |
198 | package cache. | |
199 | </VarListEntry> | |
200 | ||
c26a18b9 | 201 | <VarListEntry><Term>show <replaceable/pkg(s)/</Term> |
b2e465d6 AL |
202 | <ListItem><Para> |
203 | <literal/show/ performs a function similar to | |
c26a18b9 | 204 | <command>dpkg --print-avail</>i; it displays the package records for the |
b2e465d6 AL |
205 | named packages. |
206 | </VarListEntry> | |
207 | ||
c26a18b9 | 208 | <VarListEntry><Term>search <replaceable/regex [ regex ... ]/</Term> |
b2e465d6 | 209 | <ListItem><Para> |
cd1506b9 AL |
210 | <literal/search/ performs a full text search on all available package |
211 | lists for the regex pattern given. It searches the package names and the | |
212 | descriptions for an occurrence of the regular expression and prints out | |
213 | the package name and the short description. If <option/--full/ is given | |
214 | then output identical to <literal/show/ is produced for each matched | |
215 | package, and if <option/--names-only/ is given then the long description | |
216 | is not searched, only the package name is. | |
b2e465d6 | 217 | <para> |
7c4d986b | 218 | Separate arguments can be used to specify multiple search patterns that |
c26a18b9 | 219 | are and'ed together. |
b2e465d6 AL |
220 | </VarListEntry> |
221 | ||
c26a18b9 | 222 | <VarListEntry><Term>depends <replaceable/pkg(s)/</Term> |
b2e465d6 AL |
223 | <ListItem><Para> |
224 | <literal/depends/ shows a listing of each dependency a package has | |
c26a18b9 | 225 | and all the possible other packages that can fulfill that dependency. |
b2e465d6 AL |
226 | </VarListEntry> |
227 | ||
eba2b51d AL |
228 | <VarListEntry><Term>rdepends <replaceable/pkg(s)/</Term> |
229 | <ListItem><Para> | |
230 | <literal/rdepends/ shows a listing of each reverse dependency a package | |
231 | has. | |
232 | </VarListEntry> | |
233 | ||
c26a18b9 | 234 | <VarListEntry><Term>pkgnames <replaceable/[ prefix ]/</Term> |
b2e465d6 AL |
235 | <ListItem><Para> |
236 | This command prints the name of each package in the system. The optional | |
237 | argument is a prefix match to filter the name list. The output is suitable | |
238 | for use in a shell tab complete function and the output is generated | |
c26a18b9 | 239 | extremely quickly. This command is best used with the |
b2e465d6 AL |
240 | <option/--generate/ option. |
241 | </VarListEntry> | |
242 | ||
c26a18b9 | 243 | <VarListEntry><Term>dotty <replaceable/pkg(s)/</Term> |
b2e465d6 AL |
244 | <ListItem><Para> |
245 | <literal/dotty/ takes a list of packages on the command line and | |
c26a18b9 | 246 | generates output suitable for use by dotty from the |
877d310f | 247 | <ulink url="http://www.research.att.com/sw/tools/graphviz/">GraphViz</> |
b2e465d6 AL |
248 | package. The result will be a set of nodes and edges representing the |
249 | relationships between the packages. By default the given packages will | |
c26a18b9 AL |
250 | trace out all dependent packages; this can produce a very large graph. |
251 | To limit the output to only the packages listed on the command line, | |
252 | set the <literal>APT::Cache::GivenOnly</> option. | |
b2e465d6 AL |
253 | |
254 | <para> | |
c26a18b9 | 255 | The resulting nodes will have several shapes; normal packages are boxes, |
b2e465d6 | 256 | pure provides are triangles, mixed provides are diamonds, |
c26a18b9 AL |
257 | missing packages are hexagons. Orange boxes mean recursion was stopped |
258 | [leaf packages], blue lines are pre-depends, green lines are conflicts. | |
b2e465d6 AL |
259 | |
260 | <para> | |
261 | Caution, dotty cannot graph larger sets of packages. | |
af87ab54 | 262 | |
8b620de3 | 263 | <VarListEntry><Term>policy <replaceable/[ pkg(s) ]/</Term> |
af87ab54 AL |
264 | <ListItem><Para> |
265 | <literal/policy/ is ment to help debug issues relating to the | |
266 | preferences file. With no arguments it will print out the | |
267 | priorities of each source. Otherwise it prints out detailed information | |
268 | about the priority selection of the named package. | |
b2e465d6 | 269 | </VarListEntry> |
bd3d53ef AL |
270 | |
271 | <VarListEntry><Term>madison <replaceable/[ pkg(s) ]/</Term> | |
272 | <ListItem><Para> | |
273 | ||
274 | <literal/apt-cache/'s <literal/madison/ command attempts to mimic | |
6dd2269f AL |
275 | the output format and a subset of the functionality of the Debian |
276 | archive management tool, <literal/madison/. It displays | |
277 | available versions of a package in a tabular format. Unlike the | |
278 | original <literal/madison/, it can only display information for | |
b1424b6e | 279 | the architecture for which APT has retrieved package lists |
a521698a | 280 | (<literal/APT::Architecture/). |
bd3d53ef AL |
281 | |
282 | </VarListEntry> | |
b2e465d6 AL |
283 | </VariableList> |
284 | </RefSect1> | |
285 | ||
286 | <RefSect1><Title>Options</> | |
287 | &apt-cmdblurb; | |
288 | ||
289 | <VariableList> | |
290 | <VarListEntry><term><option/-p/</><term><option/--pkg-cache/</> | |
291 | <ListItem><Para> | |
292 | Select the file to store the package cache. The package cache is the | |
293 | primary cache used by all operations. | |
294 | Configuration Item: <literal/Dir::Cache::pkgcache/. | |
295 | </VarListEntry> | |
296 | ||
297 | <VarListEntry><term><option/-s/</><term><option/--src-cache/</> | |
298 | <ListItem><Para> | |
299 | Select the file to store the source cache. The source is used only by | |
300 | <literal/gencaches/ and it stores a parsed version of the package | |
301 | information from remote sources. When building the package cache the | |
302 | source cache is used to advoid reparsing all of the package files. | |
303 | Configuration Item: <literal/Dir::Cache::srcpkgcache/. | |
304 | </VarListEntry> | |
305 | ||
306 | <VarListEntry><term><option/-q/</><term><option/--quiet/</> | |
307 | <ListItem><Para> | |
308 | Quiet; produces output suitable for logging, omitting progress indicators. | |
7c4d986b | 309 | More q's will produce more quietness up to a maximum of 2. You can also use |
c26a18b9 | 310 | <option/-q=#/ to set the quietness level, overriding the configuration file. |
b2e465d6 AL |
311 | Configuration Item: <literal/quiet/. |
312 | </VarListEntry> | |
313 | ||
314 | <VarListEntry><term><option/-i/</><term><option/--important/</> | |
315 | <ListItem><Para> | |
7c4d986b | 316 | Print only important dependencies; for use with unmet. Causes only Depends and |
b2e465d6 AL |
317 | Pre-Depends relations to be printed. |
318 | Configuration Item: <literal/APT::Cache::Important/. | |
319 | </VarListEntry> | |
320 | ||
321 | <VarListEntry><term><option/-f/</><term><option/--full/</> | |
322 | <ListItem><Para> | |
323 | Print full package records when searching. | |
324 | Configuration Item: <literal/APT::Cache::ShowFull/. | |
325 | </VarListEntry> | |
326 | ||
327 | <VarListEntry><term><option/-a/</><term><option/--all-versions/</> | |
328 | <ListItem><Para> | |
80c0ffbd AL |
329 | Print full records for all available versions. This is the |
330 | default; to turn it off, use <option/--no-all-versions/. | |
331 | If <option/--no-all-versions/ is specified, only the candidate version | |
332 | will displayed (the one which would be selected for installation). | |
333 | This option is only applicable to the <literal/show/ command. | |
b2e465d6 AL |
334 | Configuration Item: <literal/APT::Cache::AllVersions/. |
335 | </VarListEntry> | |
336 | ||
337 | <VarListEntry><term><option/-g/</><term><option/--generate/</> | |
338 | <ListItem><Para> | |
339 | Perform automatic package cache regeneration, rather than use the cache | |
c26a18b9 | 340 | as it is. This is the default; to turn it off, use <option/--no-generate/. |
b2e465d6 AL |
341 | Configuration Item: <literal/APT::Cache::Generate/. |
342 | </VarListEntry> | |
343 | ||
8b620de3 | 344 | <VarListEntry><term><option/--names-only/</><term><option/-n/</> |
b2e465d6 | 345 | <ListItem><Para> |
c26a18b9 | 346 | Only search on the package names, not the long descriptions. |
b2e465d6 AL |
347 | Configuration Item: <literal/APT::Cache::NamesOnly/. |
348 | </VarListEntry> | |
349 | ||
350 | <VarListEntry><term><option/--all-names/</> | |
351 | <ListItem><Para> | |
352 | Make <literal/pkgnames/ print all names, including virtual packages | |
353 | and missing dependencies. | |
354 | Configuration Item: <literal/APT::Cache::AllNames/. | |
355 | </VarListEntry> | |
356 | ||
357 | <VarListEntry><term><option/--recurse/</> | |
358 | <ListItem><Para> | |
fbfbf920 AL |
359 | Make <literal/depends/ and <literal/rdepends/ recursive so that |
360 | all packages mentioned are printed once. | |
041c7082 | 361 | Configuration Item: <literal/APT::Cache::RecurseDepends/. |
b2e465d6 AL |
362 | </VarListEntry> |
363 | ||
fbfbf920 AL |
364 | <VarListEntry><term><option/--installed/</> |
365 | <ListItem><Para> | |
366 | Limit the output of <literal/depends/ and <literal/rdepends/ to | |
367 | packages which are currently installed. | |
368 | Configuration Item: <literal/APT::Cache::Installed/. | |
369 | </VarListEntry> | |
370 | ||
b2e465d6 AL |
371 | &apt-commonoptions; |
372 | ||
373 | </VariableList> | |
374 | </RefSect1> | |
375 | ||
376 | <RefSect1><Title>Files</> | |
377 | <variablelist> | |
378 | <VarListEntry><term><filename>/etc/apt/sources.list</></term> | |
379 | <ListItem><Para> | |
c26a18b9 | 380 | Locations to fetch packages from. |
b2e465d6 AL |
381 | Configuration Item: <literal/Dir::Etc::SourceList/. |
382 | </VarListEntry> | |
383 | ||
384 | <VarListEntry><term><filename>&statedir;/lists/</></term> | |
385 | <ListItem><Para> | |
c26a18b9 | 386 | Storage area for state information for each package resource specified in |
b2e465d6 AL |
387 | &sources-list; |
388 | Configuration Item: <literal/Dir::State::Lists/. | |
389 | </VarListEntry> | |
390 | ||
391 | <VarListEntry><term><filename>&statedir;/lists/partial/</></term> | |
392 | <ListItem><Para> | |
c26a18b9 | 393 | Storage area for state information in transit. |
b2e465d6 AL |
394 | Configuration Item: <literal/Dir::State::Lists/ (implicit partial). |
395 | </VarListEntry> | |
396 | </variablelist> | |
397 | </RefSect1> | |
398 | ||
399 | <RefSect1><Title>See Also</> | |
400 | <para> | |
401 | &apt-conf;, &sources-list;, &apt-get; | |
402 | </RefSect1> | |
403 | ||
404 | <RefSect1><Title>Diagnostics</> | |
405 | <para> | |
406 | <command/apt-cache/ returns zero on normal operation, decimal 100 on error. | |
407 | </RefSect1> | |
408 | ||
409 | &manbugs; | |
410 | &manauthor; | |
411 | ||
412 | </refentry> |