apt-cache.8.sgml 14 KB

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