You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

413 lines
16 KiB

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