1 <!-- -*- mode: sgml; mode: fold -*- -->
2 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
4 <!ENTITY % aptent SYSTEM "apt.ent">
13 <refentrytitle>apt-cache</>
17 <!-- Man page title -->
20 <refpurpose>APT package handling utility -- cache manipulator</>
27 <arg><option>-hvs</></arg>
28 <arg><option>-o=<replaceable/config string/</></arg>
29 <arg><option>-c=<replaceable/file/</></arg>
31 <arg>add <arg choice="plain" rep="repeat"><replaceable>file</replaceable></arg></arg>
33 <arg>showpkg <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
34 <arg>showsrc <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
39 <arg>search <arg choice="plain"><replaceable>regex</replaceable></arg></arg>
40 <arg>show <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
41 <arg>showpkg <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
42 <arg>depends <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
43 <arg>pkgnames <arg choice="plain"><replaceable>prefix</replaceable></arg></arg>
44 <arg>dotty <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
45 <arg>policy <arg choice="plain" rep="repeat"><replaceable>pkgs</replaceable></arg></arg>
50 <RefSect1><Title>Description</>
52 <command/apt-cache/ performs a variety of operations on APT's package
53 cache. <command/apt-cache/ does not manipulate the state of the system
54 but does provide operations to search and generate interesting output
55 from the package metadata.
58 Unless the <option/-h/, or <option/--help/ option is given one of the
59 commands below must be present.
62 <VarListEntry><Term>add</Term>
64 <literal/add/ adds the named package index files to the package cache.
65 This is for debugging only.
68 <VarListEntry><Term>gencaches</Term>
70 <literal/gencaches/ performs the same opration as
71 <command/apt-get check/. It builds the source and package caches from
72 the sources in &sources-list; and from <filename>/var/lib/dpkg/status</>.
75 <VarListEntry><Term>showpkg</Term>
77 <literal/showpkg/ displays information about the packages listed on the
78 command line. Remaining arguments are package names. The available
79 versions and reverse dependencies of each package listed are listed, as
80 well as forward dependencies for each version. Forward (normal)
81 dependencies are those packages upon which the package in question
82 depends; reverse dependencies are those packages that depend upon the
83 package in question. Thus, forward dependencies must be satisfied for a
84 package, but reverse dependencies need not be.
85 For instance, <command>apt-cache showpkg libreadline2</> would produce
86 output similar to the following:
88 <informalexample><programlisting>
90 Versions: 2.1-12(/var/state/apt/lists/foo_Packages),
92 libreadlineg2,libreadline2
93 libreadline2-altdev,libreadline2
95 2.1-12 - libc5 (2 5.4.0-0) ncurses3.0 (0 (null))
99 </programlisting></informalexample>
102 Thus it may be seen that libreadline2, version 2.1-12, depends on libc5 and
103 ncurses3.0 which must be installed for libreadline2 to work.
104 In turn, libreadlineg2 and libreadline2-altdev depend on libreadline2. If
105 libreadline2 is installed, libc5, ncurses3.0, and ldso must also be
106 installed; libreadlineg2 and libreadline2-altdev do not have to be
107 installed. For the specific meaning of the remainder of the output it
108 is best to consult the apt source code.
111 <VarListEntry><Term>stats</Term>
113 <literal/stats/ displays some statistics about the cache.
114 No further arguments are expected. Statistics reported are:
117 <literal/Total package names/ is the number of package names found
122 <literal/Normal packages/ is the number of regular, ordinary package
123 names; these are packages that bear a one-to-one correspondence between
124 their names and the names used by other packages for them in
125 dependencies. The majority of packages fall into this category.
129 <literal/Pure virtual packages/ is the number of packages that exist
130 only as a virtual package name; that is, packages only "provide" the
131 virtual package name, and no package actually uses the name. For
132 instance, "mail-transport-agent" in the Debian GNU/Linux system is a
133 pure virtual package; several packages provide "mail-transport-agent",
134 but there is no package named "mail-transport-agent".
138 <literal/Single virtual packages/ is the number of packages with only
139 one package providing a particular virtual package. For example, in the
140 Debian GNU/Linux system, "X11-text-viewer" is a virtual package, but
141 only one package, xless, provides "X11-text-viewer".
145 <literal/Mixed virtual packages/ is the number of packages that either
146 provide a particular virtual package or have the virtual package name
147 as the package name. For instance, in the Debian GNU/Linux system,
148 debconf is both an actual package, and provided by the debconf-tiny
153 <literal/Missing/ is the number of package names that were referenced in
154 a dependency but were not provided by any package. Missing packages may
155 be in evidence if a full distribution is not accesssed, or if a package
156 (real or virtual) has been dropped from the distribution. Usually they
157 are referenced from Conflicts statements.
161 <literal/Total distinct/ versions is the number of package versions
162 found in the cache; this value is therefore at least equal to the
163 number of total package names. If more than one distribution (both
164 "stable" and "unstable", for instance), is being accessed, this value
165 can be considerably larger than the number of total package names.
169 <literal/Total dependencies/ is the number of dependency relationships
170 claimed by all of the packages in the cache.
175 <VarListEntry><Term>showsrc</Term>
177 <literal/showsrc/ displays all the source package records that match
178 the given package names. All versions are shown, as well as all
179 records that declare the name to be a Binary.
183 <VarListEntry><Term>dump</Term>
185 <literal/dump/ shows a short listing of every package in the cache. It is
186 primarily for debugging.
189 <VarListEntry><Term>dumpavail</Term>
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.
195 <VarListEntry><Term>unmet</Term>
197 <literal/unmet/ displays a summary of all unmet dependencies in the
201 <VarListEntry><Term>show</Term>
203 <literal/show/ performs a function similar to
204 <command>dpkg --print-avail</>, it displays the package records for the
208 <VarListEntry><Term>search</Term>
210 <literal/search/ performs a full text search on all available package
211 files for the regex pattern given. It searchs the package names and the
212 descriptions for an occurance of the string and prints out the package
213 name and the short description. If <option/--full/ is given then output
214 identical to <literal/show/ is produced for each matched package and
215 if <option/--names-only/ is given then the long description is not
216 searched, only the package name is.
218 Seperate arguments can be used to specified multiple search patterns that
222 <VarListEntry><Term>depends</Term>
224 <literal/depends/ shows a listing of each dependency a package has
225 and all the possible other packages that can fullfill that dependency.
228 <VarListEntry><Term>pkgnames</Term>
230 This command prints the name of each package in the system. The optional
231 argument is a prefix match to filter the name list. The output is suitable
232 for use in a shell tab complete function and the output is generated
233 extremly quickly. This command is best used with the
234 <option/--generate/ option.
237 <VarListEntry><Term>dotty</Term>
239 <literal/dotty/ takes a list of packages on the command line and
240 gernerates output suitable for use by dotty from the
241 <ulink url="http://www.research.att.com/sw/tools/graphviz/">GraphVis</>
242 package. The result will be a set of nodes and edges representing the
243 relationships between the packages. By default the given packages will
244 trace out all dependent packages which can produce a very large graph.
245 This can be turned off by setting the
246 <literal>APT::Cache::GivenOnly</> option.
249 The resulting nodes will have several shapse, normal packages are boxes,
250 pure provides are triangles, mixed provides are diamonds,
251 hexagons are missing packages. Orange boxes mean recursion was stopped
252 [leaf packages], blue lines are prre-depends, green lines are conflicts.
255 Caution, dotty cannot graph larger sets of packages.
257 <VarListEntry><Term>policy</Term>
259 <literal/policy/ is ment to help debug issues relating to the
260 preferences file. With no arguments it will print out the
261 priorities of each source. Otherwise it prints out detailed information
262 about the priority selection of the named package.
267 <RefSect1><Title>Options</>
271 <VarListEntry><term><option/-p/</><term><option/--pkg-cache/</>
273 Select the file to store the package cache. The package cache is the
274 primary cache used by all operations.
275 Configuration Item: <literal/Dir::Cache::pkgcache/.
278 <VarListEntry><term><option/-s/</><term><option/--src-cache/</>
280 Select the file to store the source cache. The source is used only by
281 <literal/gencaches/ and it stores a parsed version of the package
282 information from remote sources. When building the package cache the
283 source cache is used to advoid reparsing all of the package files.
284 Configuration Item: <literal/Dir::Cache::srcpkgcache/.
287 <VarListEntry><term><option/-q/</><term><option/--quiet/</>
289 Quiet; produces output suitable for logging, omitting progress indicators.
290 More qs will produce more quite up to a maximum of 2. You can also use
291 <option/-q=#/ to set the quiet level, overriding the configuration file.
292 Configuration Item: <literal/quiet/.
295 <VarListEntry><term><option/-i/</><term><option/--important/</>
297 Print only important deps; for use with unmet causes only Depends and
298 Pre-Depends relations to be printed.
299 Configuration Item: <literal/APT::Cache::Important/.
302 <VarListEntry><term><option/-f/</><term><option/--full/</>
304 Print full package records when searching.
305 Configuration Item: <literal/APT::Cache::ShowFull/.
308 <VarListEntry><term><option/-a/</><term><option/--all-versions/</>
310 Print full records for all available versions, this is only applicable to
312 Configuration Item: <literal/APT::Cache::AllVersions/.
315 <VarListEntry><term><option/-g/</><term><option/--generate/</>
317 Perform automatic package cache regeneration, rather than use the cache
318 as it is. This is the default, to turn it off use <option/--no-generate/.
319 Configuration Item: <literal/APT::Cache::Generate/.
322 <VarListEntry><term><option/--names-only/</>
324 Only search on the package names, not the long description.
325 Configuration Item: <literal/APT::Cache::NamesOnly/.
328 <VarListEntry><term><option/--all-names/</>
330 Make <literal/pkgnames/ print all names, including virtual packages
331 and missing dependencies.
332 Configuration Item: <literal/APT::Cache::AllNames/.
335 <VarListEntry><term><option/--recurse/</>
337 Make <literal/depends/ recursive so that all packages mentioned are
339 Configuration Item: <literal/APT::Cache::RecurseDepends/.
347 <RefSect1><Title>Files</>
349 <VarListEntry><term><filename>/etc/apt/sources.list</></term>
351 locations to fetch packages from.
352 Configuration Item: <literal/Dir::Etc::SourceList/.
355 <VarListEntry><term><filename>&statedir;/lists/</></term>
357 storage area for state information for each package resource specified in
359 Configuration Item: <literal/Dir::State::Lists/.
362 <VarListEntry><term><filename>&statedir;/lists/partial/</></term>
364 storage area for state information in transit.
365 Configuration Item: <literal/Dir::State::Lists/ (implicit partial).
370 <RefSect1><Title>See Also</>
372 &apt-conf;, &sources-list;, &apt-get;
375 <RefSect1><Title>Diagnostics</>
377 <command/apt-cache/ returns zero on normal operation, decimal 100 on error.