~ubuntu-branches/ubuntu/trusty/apt/trusty

« back to all changes in this revision

Viewing changes to doc/en/apt-cache.8

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-04-01 17:48:58 UTC
  • mfrom: (1.4.87 sid)
  • Revision ID: package-import@ubuntu.com-20140401174858-4mv29mm29zu22fn1
Tags: 1.0.1ubuntu1
merge with the debian/sid 1.0.1 version
(LP: #1302033)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: apt-cache
 
3
.\"    Author: Jason Gunthorpe
 
4
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
 
5
.\"      Date: 09\ \&June\ \&2012
 
6
.\"    Manual: APT
 
7
.\"    Source: APT 1.0
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "APT\-CACHE" "8" "09\ \&June\ \&2012" "APT 1.0" "APT"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * Define some portability stuff
 
13
.\" -----------------------------------------------------------------
 
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
15
.\" http://bugs.debian.org/507673
 
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
 
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
18
.ie \n(.g .ds Aq \(aq
 
19
.el       .ds Aq '
 
20
.\" -----------------------------------------------------------------
 
21
.\" * set default formatting
 
22
.\" -----------------------------------------------------------------
 
23
.\" disable hyphenation
 
24
.nh
 
25
.\" disable justification (adjust text to left margin only)
 
26
.ad l
 
27
.\" -----------------------------------------------------------------
 
28
.\" * MAIN CONTENT STARTS HERE *
 
29
.\" -----------------------------------------------------------------
 
30
.SH "NAME"
 
31
apt-cache \- query the APT cache
 
32
.SH "SYNOPSIS"
 
33
.HP \w'\fBapt\-cache\fR\ 'u
 
34
\fBapt\-cache\fR [\fB\-agipns\fR] [\fB\-o=\fR\fB\fIconfig_string\fR\fR] [\fB\-c=\fR\fB\fIconfig_file\fR\fR] {gencaches | showpkg\ \fIpkg\fR...  | showsrc\ \fIpkg\fR...  | stats | dump | dumpavail | unmet | search\ \fIregex\fR...  | show\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]...  | depends\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]...  | rdepends\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]...  | pkgnames\ [\fIprefix\fR]  | dotty\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]...  | xvcg\ \fIpkg\fR\ [{=\fIpkg_version_number\fR\ |\ /\fItarget_release\fR}]...  | policy\ [\fIpkg\fR...]  | madison\ \fIpkg\fR...  | {\-v\ |\ \-\-version} | {\-h\ |\ \-\-help}}
 
35
.SH "DESCRIPTION"
 
36
.PP
 
37
\fBapt\-cache\fR
 
38
performs a variety of operations on APT\*(Aqs package cache\&.
 
39
\fBapt\-cache\fR
 
40
does not manipulate the state of the system but does provide operations to search and generate interesting output from the package metadata\&.
 
41
.PP
 
42
Unless the
 
43
\fB\-h\fR, or
 
44
\fB\-\-help\fR
 
45
option is given, one of the commands below must be present\&.
 
46
.PP
 
47
\fBgencaches\fR
 
48
.RS 4
 
49
gencaches
 
50
creates APT\*(Aqs package cache\&. This is done implicitly by all commands needing this cache if it is missing or outdated\&.
 
51
.RE
 
52
.PP
 
53
\fBshowpkg\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
54
.RS 4
 
55
showpkg
 
56
displays information about the packages listed on the command line\&. Remaining arguments are package names\&. The available versions and reverse dependencies of each package listed are listed, as well as forward dependencies for each version\&. Forward (normal) dependencies are those packages upon which the package in question depends; reverse dependencies are those packages that depend upon the package in question\&. Thus, forward dependencies must be satisfied for a package, but reverse dependencies need not be\&. For instance,
 
57
\fBapt\-cache showpkg libreadline2\fR
 
58
would produce output similar to the following:
 
59
.sp
 
60
.if n \{\
 
61
.RS 4
 
62
.\}
 
63
.nf
 
64
Package: libreadline2
 
65
Versions: 2\&.1\-12(/var/state/apt/lists/foo_Packages),
 
66
Reverse Depends: 
 
67
  libreadlineg2,libreadline2
 
68
  libreadline2\-altdev,libreadline2
 
69
Dependencies:
 
70
2\&.1\-12 \- libc5 (2 5\&.4\&.0\-0) ncurses3\&.0 (0 (null))
 
71
Provides:
 
72
2\&.1\-12 \- 
 
73
Reverse Provides: 
 
74
.fi
 
75
.if n \{\
 
76
.RE
 
77
.\}
 
78
Thus it may be seen that libreadline2, version 2\&.1\-12, depends on libc5 and ncurses3\&.0 which must be installed for libreadline2 to work\&. In turn, libreadlineg2 and libreadline2\-altdev depend on libreadline2\&. If libreadline2 is installed, libc5 and ncurses3\&.0 (and ldso) must also be installed; libreadlineg2 and libreadline2\-altdev do not have to be installed\&. For the specific meaning of the remainder of the output it is best to consult the apt source code\&.
 
79
.RE
 
80
.PP
 
81
\fBstats\fR
 
82
.RS 4
 
83
stats
 
84
displays some statistics about the cache\&. No further arguments are expected\&. Statistics reported are:
 
85
.sp
 
86
.RS 4
 
87
.ie n \{\
 
88
\h'-04'\(bu\h'+03'\c
 
89
.\}
 
90
.el \{\
 
91
.sp -1
 
92
.IP \(bu 2.3
 
93
.\}
 
94
Total package names
 
95
is the number of package names found in the cache\&.
 
96
.RE
 
97
.sp
 
98
.RS 4
 
99
.ie n \{\
 
100
\h'-04'\(bu\h'+03'\c
 
101
.\}
 
102
.el \{\
 
103
.sp -1
 
104
.IP \(bu 2.3
 
105
.\}
 
106
Normal packages
 
107
is the number of regular, ordinary package names; these are packages that bear a one\-to\-one correspondence between their names and the names used by other packages for them in dependencies\&. The majority of packages fall into this category\&.
 
108
.RE
 
109
.sp
 
110
.RS 4
 
111
.ie n \{\
 
112
\h'-04'\(bu\h'+03'\c
 
113
.\}
 
114
.el \{\
 
115
.sp -1
 
116
.IP \(bu 2.3
 
117
.\}
 
118
Pure virtual packages
 
119
is the number of packages that exist only as a virtual package name; that is, packages only "provide" the virtual package name, and no package actually uses the name\&. For instance, "mail\-transport\-agent" in the Debian system is a pure virtual package; several packages provide "mail\-transport\-agent", but there is no package named "mail\-transport\-agent"\&.
 
120
.RE
 
121
.sp
 
122
.RS 4
 
123
.ie n \{\
 
124
\h'-04'\(bu\h'+03'\c
 
125
.\}
 
126
.el \{\
 
127
.sp -1
 
128
.IP \(bu 2.3
 
129
.\}
 
130
Single virtual packages
 
131
is the number of packages with only one package providing a particular virtual package\&. For example, in the Debian system, "X11\-text\-viewer" is a virtual package, but only one package, xless, provides "X11\-text\-viewer"\&.
 
132
.RE
 
133
.sp
 
134
.RS 4
 
135
.ie n \{\
 
136
\h'-04'\(bu\h'+03'\c
 
137
.\}
 
138
.el \{\
 
139
.sp -1
 
140
.IP \(bu 2.3
 
141
.\}
 
142
Mixed virtual packages
 
143
is the number of packages that either provide a particular virtual package or have the virtual package name as the package name\&. For instance, in the Debian system, "debconf" is both an actual package, and provided by the debconf\-tiny package\&.
 
144
.RE
 
145
.sp
 
146
.RS 4
 
147
.ie n \{\
 
148
\h'-04'\(bu\h'+03'\c
 
149
.\}
 
150
.el \{\
 
151
.sp -1
 
152
.IP \(bu 2.3
 
153
.\}
 
154
Missing
 
155
is the number of package names that were referenced in a dependency but were not provided by any package\&. Missing packages may be an evidence if a full distribution is not accessed, or if a package (real or virtual) has been dropped from the distribution\&. Usually they are referenced from Conflicts or Breaks statements\&.
 
156
.RE
 
157
.sp
 
158
.RS 4
 
159
.ie n \{\
 
160
\h'-04'\(bu\h'+03'\c
 
161
.\}
 
162
.el \{\
 
163
.sp -1
 
164
.IP \(bu 2.3
 
165
.\}
 
166
Total distinct
 
167
versions is the number of package versions found in the cache; this value is therefore at least equal to the number of total package names\&. If more than one distribution is being accessed (for instance, "stable" and "unstable"), this value can be considerably larger than the number of total package names\&.
 
168
.RE
 
169
.sp
 
170
.RS 4
 
171
.ie n \{\
 
172
\h'-04'\(bu\h'+03'\c
 
173
.\}
 
174
.el \{\
 
175
.sp -1
 
176
.IP \(bu 2.3
 
177
.\}
 
178
Total dependencies
 
179
is the number of dependency relationships claimed by all of the packages in the cache\&.
 
180
.RE
 
181
.sp
 
182
.RE
 
183
.PP
 
184
\fBshowsrc\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
185
.RS 4
 
186
showsrc
 
187
displays all the source package records that match the given package names\&. All versions are shown, as well as all records that declare the name to be a binary package\&.
 
188
.RE
 
189
.PP
 
190
\fBdump\fR
 
191
.RS 4
 
192
dump
 
193
shows a short listing of every package in the cache\&. It is primarily for debugging\&.
 
194
.RE
 
195
.PP
 
196
\fBdumpavail\fR
 
197
.RS 4
 
198
dumpavail
 
199
prints out an available list to stdout\&. This is suitable for use with
 
200
\fBdpkg\fR(1)
 
201
and is used by the
 
202
\fBdselect\fR(1)
 
203
method\&.
 
204
.RE
 
205
.PP
 
206
\fBunmet\fR
 
207
.RS 4
 
208
unmet
 
209
displays a summary of all unmet dependencies in the package cache\&.
 
210
.RE
 
211
.PP
 
212
\fBshow\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
213
.RS 4
 
214
show
 
215
performs a function similar to
 
216
\fBdpkg \-\-print\-avail\fR; it displays the package records for the named packages\&.
 
217
.RE
 
218
.PP
 
219
\fBsearch\fR \fB\fIregex\fR\fR\fB\&...\fR
 
220
.RS 4
 
221
search
 
222
performs a full text search on all available package lists for the POSIX regex pattern given, see
 
223
\fBregex\fR(7)\&. It searches the package names and the descriptions for an occurrence of the regular expression and prints out the package name and the short description, including virtual package names\&. If
 
224
\fB\-\-full\fR
 
225
is given then output identical to
 
226
show
 
227
is produced for each matched package, and if
 
228
\fB\-\-names\-only\fR
 
229
is given then the long description is not searched, only the package name is\&.
 
230
.sp
 
231
Separate arguments can be used to specify multiple search patterns that are and\*(Aqed together\&.
 
232
.RE
 
233
.PP
 
234
\fBdepends\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
235
.RS 4
 
236
depends
 
237
shows a listing of each dependency a package has and all the possible other packages that can fulfill that dependency\&.
 
238
.RE
 
239
.PP
 
240
\fBrdepends\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
241
.RS 4
 
242
rdepends
 
243
shows a listing of each reverse dependency a package has\&.
 
244
.RE
 
245
.PP
 
246
\fBpkgnames\fR [\fIprefix\fR]
 
247
.RS 4
 
248
This command prints the name of each package APT knows\&. The optional argument is a prefix match to filter the name list\&. The output is suitable for use in a shell tab complete function and the output is generated extremely quickly\&. This command is best used with the
 
249
\fB\-\-generate\fR
 
250
option\&.
 
251
.sp
 
252
Note that a package which APT knows of is not necessarily available to download, installable or installed, e\&.g\&. virtual packages are also listed in the generated list\&.
 
253
.RE
 
254
.PP
 
255
\fBdotty\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
256
.RS 4
 
257
dotty
 
258
takes a list of packages on the command line and generates output suitable for use by dotty from the
 
259
\m[blue]\fBGraphViz\fR\m[]\&\s-2\u[1]\d\s+2
 
260
package\&. The result will be a set of nodes and edges representing the relationships between the packages\&. By default the given packages will trace out all dependent packages; this can produce a very large graph\&. To limit the output to only the packages listed on the command line, set the
 
261
APT::Cache::GivenOnly
 
262
option\&.
 
263
.sp
 
264
The resulting nodes will have several shapes; normal packages are boxes, pure virtual packages are triangles, mixed virtual packages are diamonds, missing packages are hexagons\&. Orange boxes mean recursion was stopped (leaf packages), blue lines are pre\-depends, green lines are conflicts\&.
 
265
.sp
 
266
Caution, dotty cannot graph larger sets of packages\&.
 
267
.RE
 
268
.PP
 
269
\fBxvcg\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
270
.RS 4
 
271
The same as
 
272
dotty, only for xvcg from the
 
273
\m[blue]\fBVCG tool\fR\m[]\&\s-2\u[2]\d\s+2\&.
 
274
.RE
 
275
.PP
 
276
\fBpolicy\fR [\fIpkg\fR\&...]
 
277
.RS 4
 
278
policy
 
279
is meant to help debug issues relating to the preferences file\&. With no arguments it will print out the priorities of each source\&. Otherwise it prints out detailed information about the priority selection of the named package\&.
 
280
.RE
 
281
.PP
 
282
\fBmadison\fR \fB\fIpkg\fR\fR\fB\&...\fR
 
283
.RS 4
 
284
apt\-cache\*(Aqs
 
285
madison
 
286
command attempts to mimic the output format and a subset of the functionality of the Debian archive management tool,
 
287
madison\&. It displays available versions of a package in a tabular format\&. Unlike the original
 
288
madison, it can only display information for the architecture for which APT has retrieved package lists (APT::Architecture)\&.
 
289
.RE
 
290
.SH "OPTIONS"
 
291
.PP
 
292
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set\&. For boolean options you can override the config file by using something like
 
293
\fB\-f\-\fR,\fB\-\-no\-f\fR,
 
294
\fB\-f=no\fR
 
295
or several other variations\&.
 
296
.PP
 
297
\fB\-p\fR, \fB\-\-pkg\-cache\fR
 
298
.RS 4
 
299
Select the file to store the package cache\&. The package cache is the primary cache used by all operations\&. Configuration Item:
 
300
Dir::Cache::pkgcache\&.
 
301
.RE
 
302
.PP
 
303
\fB\-s\fR, \fB\-\-src\-cache\fR
 
304
.RS 4
 
305
Select the file to store the source cache\&. The source is used only by
 
306
gencaches
 
307
and it stores a parsed version of the package information from remote sources\&. When building the package cache the source cache is used to avoid reparsing all of the package files\&. Configuration Item:
 
308
Dir::Cache::srcpkgcache\&.
 
309
.RE
 
310
.PP
 
311
\fB\-q\fR, \fB\-\-quiet\fR
 
312
.RS 4
 
313
Quiet; produces output suitable for logging, omitting progress indicators\&. More q\*(Aqs will produce more quietness up to a maximum of 2\&. You can also use
 
314
\fB\-q=#\fR
 
315
to set the quietness level, overriding the configuration file\&. Configuration Item:
 
316
quiet\&.
 
317
.RE
 
318
.PP
 
319
\fB\-i\fR, \fB\-\-important\fR
 
320
.RS 4
 
321
Print only important dependencies; for use with
 
322
unmet
 
323
and
 
324
depends\&. Causes only Depends and Pre\-Depends relations to be printed\&. Configuration Item:
 
325
APT::Cache::Important\&.
 
326
.RE
 
327
.PP
 
328
\fB\-\-no\-pre\-depends\fR, \fB\-\-no\-depends\fR, \fB\-\-no\-recommends\fR, \fB\-\-no\-suggests\fR, \fB\-\-no\-conflicts\fR, \fB\-\-no\-breaks\fR, \fB\-\-no\-replaces\fR, \fB\-\-no\-enhances\fR
 
329
.RS 4
 
330
Per default the
 
331
depends
 
332
and
 
333
rdepends
 
334
print all dependencies\&. This can be tweaked with these flags which will omit the specified dependency type\&. Configuration Item:
 
335
APT::Cache::Show\fIDependencyType\fR
 
336
e\&.g\&.
 
337
APT::Cache::ShowRecommends\&.
 
338
.RE
 
339
.PP
 
340
\fB\-f\fR, \fB\-\-full\fR
 
341
.RS 4
 
342
Print full package records when searching\&. Configuration Item:
 
343
APT::Cache::ShowFull\&.
 
344
.RE
 
345
.PP
 
346
\fB\-a\fR, \fB\-\-all\-versions\fR
 
347
.RS 4
 
348
Print full records for all available versions\&. This is the default; to turn it off, use
 
349
\fB\-\-no\-all\-versions\fR\&. If
 
350
\fB\-\-no\-all\-versions\fR
 
351
is specified, only the candidate version will be displayed (the one which would be selected for installation)\&. This option is only applicable to the
 
352
show
 
353
command\&. Configuration Item:
 
354
APT::Cache::AllVersions\&.
 
355
.RE
 
356
.PP
 
357
\fB\-g\fR, \fB\-\-generate\fR
 
358
.RS 4
 
359
Perform automatic package cache regeneration, rather than use the cache as it is\&. This is the default; to turn it off, use
 
360
\fB\-\-no\-generate\fR\&. Configuration Item:
 
361
APT::Cache::Generate\&.
 
362
.RE
 
363
.PP
 
364
\fB\-\-names\-only\fR, \fB\-n\fR
 
365
.RS 4
 
366
Only search on the package names, not the long descriptions\&. Configuration Item:
 
367
APT::Cache::NamesOnly\&.
 
368
.RE
 
369
.PP
 
370
\fB\-\-all\-names\fR
 
371
.RS 4
 
372
Make
 
373
pkgnames
 
374
print all names, including virtual packages and missing dependencies\&. Configuration Item:
 
375
APT::Cache::AllNames\&.
 
376
.RE
 
377
.PP
 
378
\fB\-\-recurse\fR
 
379
.RS 4
 
380
Make
 
381
depends
 
382
and
 
383
rdepends
 
384
recursive so that all packages mentioned are printed once\&. Configuration Item:
 
385
APT::Cache::RecurseDepends\&.
 
386
.RE
 
387
.PP
 
388
\fB\-\-installed\fR
 
389
.RS 4
 
390
Limit the output of
 
391
depends
 
392
and
 
393
rdepends
 
394
to packages which are currently installed\&. Configuration Item:
 
395
APT::Cache::Installed\&.
 
396
.RE
 
397
.PP
 
398
\fB\-h\fR, \fB\-\-help\fR
 
399
.RS 4
 
400
Show a short usage summary\&.
 
401
.RE
 
402
.PP
 
403
\fB\-v\fR, \fB\-\-version\fR
 
404
.RS 4
 
405
Show the program version\&.
 
406
.RE
 
407
.PP
 
408
\fB\-c\fR, \fB\-\-config\-file\fR
 
409
.RS 4
 
410
Configuration File; Specify a configuration file to use\&. The program will read the default configuration file and then this configuration file\&. If configuration settings need to be set before the default configuration files are parsed specify a file with the
 
411
\fBAPT_CONFIG\fR
 
412
environment variable\&. See
 
413
\fBapt.conf\fR(5)
 
414
for syntax information\&.
 
415
.RE
 
416
.PP
 
417
\fB\-o\fR, \fB\-\-option\fR
 
418
.RS 4
 
419
Set a Configuration Option; This will set an arbitrary configuration option\&. The syntax is
 
420
\fB\-o Foo::Bar=bar\fR\&.
 
421
\fB\-o\fR
 
422
and
 
423
\fB\-\-option\fR
 
424
can be used multiple times to set different options\&.
 
425
.RE
 
426
.SH "FILES"
 
427
.PP
 
428
/etc/apt/sources\&.list
 
429
.RS 4
 
430
Locations to fetch packages from\&. Configuration Item:
 
431
Dir::Etc::SourceList\&.
 
432
.RE
 
433
.PP
 
434
/etc/apt/sources\&.list\&.d/
 
435
.RS 4
 
436
File fragments for locations to fetch packages from\&. Configuration Item:
 
437
Dir::Etc::SourceParts\&.
 
438
.RE
 
439
.PP
 
440
/var/lib/apt/lists/
 
441
.RS 4
 
442
Storage area for state information for each package resource specified in
 
443
\fBsources.list\fR(5)
 
444
Configuration Item:
 
445
Dir::State::Lists\&.
 
446
.RE
 
447
.PP
 
448
/var/lib/apt/lists/partial/
 
449
.RS 4
 
450
Storage area for state information in transit\&. Configuration Item:
 
451
Dir::State::Lists
 
452
(partial
 
453
will be implicitly appended)
 
454
.RE
 
455
.SH "SEE ALSO"
 
456
.PP
 
457
\fBapt.conf\fR(5),
 
458
\fBsources.list\fR(5),
 
459
\fBapt-get\fR(8)
 
460
.SH "DIAGNOSTICS"
 
461
.PP
 
462
\fBapt\-cache\fR
 
463
returns zero on normal operation, decimal 100 on error\&.
 
464
.SH "BUGS"
 
465
.PP
 
466
\m[blue]\fBAPT bug page\fR\m[]\&\s-2\u[3]\d\s+2\&. If you wish to report a bug in APT, please see
 
467
/usr/share/doc/debian/bug\-reporting\&.txt
 
468
or the
 
469
\fBreportbug\fR(1)
 
470
command\&.
 
471
.SH "AUTHORS"
 
472
.PP
 
473
\fBJason Gunthorpe\fR
 
474
.RS 4
 
475
.RE
 
476
.PP
 
477
\fBAPT team\fR
 
478
.RS 4
 
479
.RE
 
480
.SH "NOTES"
 
481
.IP " 1." 4
 
482
GraphViz
 
483
.RS 4
 
484
\%http://www.research.att.com/sw/tools/graphviz/
 
485
.RE
 
486
.IP " 2." 4
 
487
VCG tool
 
488
.RS 4
 
489
\%http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html
 
490
.RE
 
491
.IP " 3." 4
 
492
APT bug page
 
493
.RS 4
 
494
\%http://bugs.debian.org/src:apt
 
495
.RE