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</>
26 <command>apt-config</>
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>
38 <arg>search <arg choice="plain"><replaceable>regex</replaceable></arg></arg>
39 <arg>show <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
40 <arg>showpkg <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
41 <arg>depends <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
42 <arg>pkgnames <arg choice="plain"><replaceable>prefix</replaceable></arg></arg>
43 <arg>dotty <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
48 <RefSect1><Title>Description</>
50 <command/apt-cache/ performs a variety of operations on APT's package
51 cache. <command/apt-cache/ does not manipulate the state of the system
52 but does provide operations to search and generate interesting output
53 from the package metadata.
56 Unless the <option/-h/, or <option/--help/ option is given one of the
57 above commands must be present.
60 <VarListEntry><Term>add</Term>
62 <literal/add/ adds the names package index files to the package cache.
65 <VarListEntry><Term>gencaches</Term>
67 <literal/gencaches/ performs the same opration as
68 <command/apt-get check/. It builds the source and package caches from
69 the sources in &sources-list; and from <filename>/var/lib/dpkg/status</>.
72 <VarListEntry><Term>showpkg</Term>
74 <literal/showpkg/ displays information about the packages listed on the
75 command line. Remaining arguments are package names. The available
76 versions and reverse dependencies of each package listed are listed, as
77 well as forward dependencies for each version. Forward (normal)
78 dependencies are those packages upon which the package in question
79 depends; reverse dependencies are those packages that depend upon the
80 package in question. Thus, forward dependencies must be satisfied for a
81 package, but reverse dependencies need not be.
82 For instance, <command>apt-cache showpkg libreadline2</> would produce
83 output similar to the following:
85 <informalexample><programlisting>
87 Versions: 2.1-12(/var/state/apt/lists/foo_Packages),
89 libreadlineg2,libreadline2
90 libreadline2-altdev,libreadline2
92 2.1-12 - libc5 (2 5.4.0-0) ncurses3.0 (0 (null))
96 </programlisting></informalexample>
99 Thus it may be seen that libreadline2, version 2.1-8, depends on libc5,
100 ncurses3.0, and ldso, which must be installed for libreadline2 to work.
101 In turn, libreadlineg2 and libreadline2-altdev depend on libreadline2. If
102 libreadline2 is installed, libc5, ncurses3.0, and ldso must also be
103 installed; libreadlineg2 and libreadline2-altdev do not have to be
104 installed. For the specific meaning of the remainder of the output it
105 is best to consult the apt source code.
108 <VarListEntry><Term>stats</Term>
110 <literal/stats/ displays some statistics about the cache.
111 No further arguments are expected. Statistics reported are:
114 <literal/Total package names/ is the number of package names found
119 <literal/Normal packages/ is the number of regular, ordinary package
120 names; these are packages that bear a one-to-one correspondence between
121 their names and the names used by other packages for them in
122 dependencies. The majority of packages fall into this category.
126 <literal/Pure virtual packages/ is the number of packages that exist
127 only as a virtual package name; that is, packages only "provide" the
128 virtual package name, and no package actually uses the name. For
129 instance, "mail-transport-agent" in the Debian GNU/Linux system is a
130 pure virtual package; several packages provide "mail-transport-agent",
131 but there is no package named "mail-transport-agent".
135 <literal/Single virtual packages/ is the number of packages with only
136 one package providing a particular virtual package. For example, in the
137 Debian GNU/Linux system, "X11-text-viewer" is a virtual package, but
138 only one package, xless, provides "X11-text-viewer".
142 <literal/Mixed virtual packages/ is the number of packages that either
143 provide a particular virtual package or have the virtual package name
144 as the package name. For instance, in the Debian GNU/Linux system,
145 debconf is both an actual package, and provided by the debconf-tiny
150 <literal/Missing/ is the number of package names that were referenced in
151 a dependency but were not provided by any package. Missing packages may
152 be in evidence if a full distribution is not accesssed, or if a package
153 (real or virtual) has been dropped from the distribution. Usually they
154 are referenced from Conflicts statements.
158 <literal/Total distinct/ versions is the number of package versions
159 found in the cache; this value is therefore at least equal to the
160 number of total package names. If more than one distribution (both
161 "stable" and "unstable", for instance), is being accessed, this value
162 can be considerably larger than the number of total package names.
166 <literal/Total dependencies/ is the number of dependency relationships
167 claimed by all of the packages in the cache.
172 <VarListEntry><Term>dump</Term>
174 <literal/dump/ shows a short listing of every package in the cache. It is
175 primarily for debugging.
178 <VarListEntry><Term>dumpavail</Term>
180 <literal/dumpavail/ prints out an available list to stdout. This is
181 suitable for use with &dpkg; and is used by the &dselect; method.
184 <VarListEntry><Term>unmet</Term>
186 <literal/unmet/ displays a summary of all unmet dependencies in the
190 <VarListEntry><Term>show</Term>
192 <literal/show/ performs a function similar to
193 <command>dpkg --print-avail</>, it displays the package records for the
197 <VarListEntry><Term>search</Term>
199 <literal/search/ performs a full text search on all available package
200 files for the regex pattern given. It searchs the package names and the
201 descriptions for an occurance of the string and prints out the package
202 name and the short description. If <option/--full/ is given then output
203 identical to <literal/show/ is produced for each matched package and
204 if <option/--names-only/ is given then the long description is not
205 searched, only the package name is.
207 Seperate arguments can be used to specified multiple search patterns that
211 <VarListEntry><Term>depends</Term>
213 <literal/depends/ shows a listing of each dependency a package has
214 and all the possible other packages that can fullfill that dependency.
217 <VarListEntry><Term>pkgnames</Term>
219 This command prints the name of each package in the system. The optional
220 argument is a prefix match to filter the name list. The output is suitable
221 for use in a shell tab complete function and the output is generated
222 extremly quickly. This command is best used with the
223 <option/--generate/ option.
226 <VarListEntry><Term>dotty</Term>
228 <literal/dotty/ takes a list of packages on the command line and
229 gernerates output suitable for use by dotty from the
230 <ulink url="http://www.research.att.com/sw/tools/graphviz/">GraphVis</>
231 package. The result will be a set of nodes and edges representing the
232 relationships between the packages. By default the given packages will
233 trace out all dependent packages which can produce a very large graph.
234 This can be turned off by setting the
235 <literal>APT::Cache::GivenOnly</> option.
238 The resulting nodes will have several shapse, normal packages are boxes,
239 pure provides are triangles, mixed provides are diamonds,
240 hexagons are missing packages. Orange boxes mean recursion was stopped
241 [leaf packages], blue lines are prre-depends, green lines are conflicts.
244 Caution, dotty cannot graph larger sets of packages.
249 <RefSect1><Title>Options</>
253 <VarListEntry><term><option/-p/</><term><option/--pkg-cache/</>
255 Select the file to store the package cache. The package cache is the
256 primary cache used by all operations.
257 Configuration Item: <literal/Dir::Cache::pkgcache/.
260 <VarListEntry><term><option/-s/</><term><option/--src-cache/</>
262 Select the file to store the source cache. The source is used only by
263 <literal/gencaches/ and it stores a parsed version of the package
264 information from remote sources. When building the package cache the
265 source cache is used to advoid reparsing all of the package files.
266 Configuration Item: <literal/Dir::Cache::srcpkgcache/.
269 <VarListEntry><term><option/-q/</><term><option/--quiet/</>
271 Quiet; produces output suitable for logging, omitting progress indicators.
272 More qs will produce more quite up to a maximum of 2. You can also use
273 <option/-q=#/ to set the quiet level, overriding the configuration file.
274 Configuration Item: <literal/quiet/.
277 <VarListEntry><term><option/-i/</><term><option/--important/</>
279 Print only important deps; for use with unmet causes only Depends and
280 Pre-Depends relations to be printed.
281 Configuration Item: <literal/APT::Cache::Important/.
284 <VarListEntry><term><option/-f/</><term><option/--full/</>
286 Print full package records when searching.
287 Configuration Item: <literal/APT::Cache::ShowFull/.
290 <VarListEntry><term><option/-a/</><term><option/--all-versions/</>
292 Print full records for all available versions, this is only applicable to
294 Configuration Item: <literal/APT::Cache::AllVersions/.
297 <VarListEntry><term><option/-g/</><term><option/--generate/</>
299 Perform automatic package cache regeneration, rather than use the cache
300 as it is. This is the default, to turn it off use <option/--no-generate/.
301 Configuration Item: <literal/APT::Cache::Generate/.
304 <VarListEntry><term><option/--names-only/</>
306 Only search on the package names, not the long description.
307 Configuration Item: <literal/APT::Cache::NamesOnly/.
310 <VarListEntry><term><option/--all-names/</>
312 Make <literal/pkgnames/ print all names, including virtual packages
313 and missing dependencies.
314 Configuration Item: <literal/APT::Cache::AllNames/.
317 <VarListEntry><term><option/--recurse/</>
319 Make <literal/depends/ recursive so that all packages mentioned are
321 Configuration Item: <literal/APT::Cache::RecruseDepends/.
329 <RefSect1><Title>Files</>
331 <VarListEntry><term><filename>/etc/apt/sources.list</></term>
333 locations to fetch packages from.
334 Configuration Item: <literal/Dir::Etc::SourceList/.
337 <VarListEntry><term><filename>&statedir;/lists/</></term>
339 storage area for state information for each package resource specified in
341 Configuration Item: <literal/Dir::State::Lists/.
344 <VarListEntry><term><filename>&statedir;/lists/partial/</></term>
346 storage area for state information in transit.
347 Configuration Item: <literal/Dir::State::Lists/ (implicit partial).
352 <RefSect1><Title>See Also</>
354 &apt-conf;, &sources-list;, &apt-get;
357 <RefSect1><Title>Diagnostics</>
359 <command/apt-cache/ returns zero on normal operation, decimal 100 on error.