apt-cache.8.sgml 15 KB

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