apt-cache.8.sgml 15 KB

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