apt-get.8.sgml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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-get</>
  10. <manvolnum>8</>
  11. </refmeta>
  12. <!-- Man page title -->
  13. <refnamediv>
  14. <refname>apt-get</>
  15. <refpurpose>APT package handling utility -- command-line interface</>
  16. </refnamediv>
  17. <!-- Arguments -->
  18. <refsynopsisdiv>
  19. <cmdsynopsis>
  20. <command>apt-get</>
  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>update</>
  26. <arg>upgrade</>
  27. <arg>dselect-upgrade</>
  28. <arg>install <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
  29. <arg>remove <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
  30. <arg>source <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
  31. <arg>build-dep <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
  32. <arg>check</>
  33. <arg>clean</>
  34. <arg>autoclean</>
  35. </group>
  36. </cmdsynopsis>
  37. </refsynopsisdiv>
  38. <RefSect1><Title>Description</>
  39. <para>
  40. <command/apt-get/ is the command-line tool for handling packages, and may be
  41. considered the user's "back-end" to other tools using the APT library.
  42. <para>
  43. Unless the <option/-h/, or <option/--help/ option is given one of the
  44. commands below must be present.
  45. <VariableList>
  46. <VarListEntry><Term>update</Term>
  47. <ListItem><Para>
  48. <literal/update/ is used to resynchronize the package index files from
  49. their sources. The indexes of available packages are fetched from the
  50. location(s) specified in <filename>/etc/apt/sources.list</>.
  51. For example, when using a Debian archive, this command retrieves and
  52. scans the <filename>Packages.gz</> files, so that information about new
  53. and updated packages is available. An <literal/update/ should always be
  54. performed before an <literal/upgrade/ or <literal/dist-upgrade/. Please
  55. be aware that the overall progress meter will be incorrect as the size
  56. of the package files cannot be known in advance.
  57. </VarListEntry>
  58. <VarListEntry><Term>upgrade</Term>
  59. <ListItem><Para>
  60. <literal/upgrade/ is used to install the newest versions of all packages
  61. currently installed on the system from the sources enumerated in
  62. <filename>/etc/apt/sources.list</>. Packages currently installed with
  63. new versions available are retrieved and upgraded; under no circumstances
  64. are currently installed packages removed, or packages not already installed
  65. retrieved and installed. New versions of currently installed packages that
  66. cannot be upgraded without changing the install status of another package
  67. will be left at their current version. An <literal/update/ must be
  68. performed first so that <command/apt-get/ knows that new versions of packages are
  69. available.
  70. </VarListEntry>
  71. <VarListEntry><Term>dselect-upgrade</Term>
  72. <ListItem><Para>
  73. is used in conjunction with the traditional Debian GNU/Linux packaging
  74. front-end, &dselect;. <literal/dselect-upgrade/
  75. follows the changes made by &dselect; to the <literal/Status/
  76. field of available packages, and performs the actions necessary to realize
  77. that state (for instance, the removal of old and the installation of new
  78. packages).
  79. </VarListEntry>
  80. <VarListEntry><Term>dist-upgrade</Term>
  81. <ListItem><Para>
  82. <literal/dist-upgrade/, in addition to performing the function of
  83. <literal/upgrade/, also intelligently handles changing dependencies
  84. with new versions of packages; <command/apt-get/ has a "smart" conflict
  85. resolution system, and it will attempt to upgrade the most important
  86. packages at the expense of less important ones if necessary.
  87. The <filename>/etc/apt/sources.list</> file contains a list of locations
  88. from which to retrieve desired package files.
  89. </VarListEntry>
  90. <VarListEntry><Term>install</Term>
  91. <ListItem><Para>
  92. <literal/install/ is followed by one or more packages desired for
  93. installation. Each package is a package name, not a fully qualified
  94. filename (for instance, in a Debian GNU/Linux system, libc6 would be the
  95. argument provided, not em(libc6_1.9.6-2.deb)). All packages required
  96. by the package(s) specified for installation will also be retrieved and
  97. installed. The <filename>/etc/apt/sources.list</> file is used to locate
  98. the desired packages. If a hyphen is appended to the package name (with
  99. no intervening space), the identified package will be removed if it is
  100. installed. Similarly a plus sign can be used to designate a package to
  101. install. These latter features may be used to override decisions made by
  102. apt-get's conflict resolution system.
  103. <para>
  104. A specific version of a package can be selected for installation by
  105. following the package name with an equals and the version of the package
  106. to select. This will cause that version to be located and selected for
  107. install. Alternatively a specific distribution can be selected by
  108. following the package name with a slash and the version of the
  109. distribution or the Archive name (stable, frozen, unstable).
  110. <para>
  111. Both of the version selection mechanisms can downgrade packages and must
  112. be used with care.
  113. <para>
  114. If no package matches the given expression and the expression contains one
  115. of '.', '?' or '*' then it is assumed to be a POSIX regex and it is applied
  116. to all package names in the database. Any matches are then installed (or
  117. removed). Note that matching is done by substring so 'lo.*' matches 'how-lo'
  118. and 'lowest'. If this is undesired prefix with a '^' character.
  119. </VarListEntry>
  120. <VarListEntry><Term>remove</Term>
  121. <ListItem><Para>
  122. <literal/remove/ is identical to <literal/install/ except that packages are
  123. removed instead of installed. If a plus sign is appended to the package
  124. name (with no intervening space), the identified package will be
  125. installed.
  126. </VarListEntry>
  127. <VarListEntry><Term>source</Term>
  128. <ListItem><Para>
  129. <literal/source/ causes <command/apt-get/ to fetch source packages. APT
  130. will examine the available packages to decide which source package to
  131. fetch. It will then find and download into the current directory the
  132. newest available version of that source package. Source packages are
  133. tracked separately from binary packages via <literal/deb-src/ type lines
  134. in the &sources-list; file. This probably will mean that you will not
  135. get the same source as the package you have installed or as you could
  136. install. If the --compile options is specified then the package will be
  137. compiled to a binary .deb using dpkg-buildpackage, if --download-only is
  138. specified then the source package will not be unpacked.
  139. <para>
  140. A specific source version can be retrieved by postfixing the source name
  141. with an equals and then the version to fetch, similar to the mechanism
  142. used for the package files. This enables exact matching of the source
  143. package name and version, implicitly enabling the
  144. <literal/APT::Get::Only-Source/ option.
  145. <para>
  146. Note that source packages are not tracked like binary packages, they
  147. exist only in the current directory and are similar to downloading source
  148. tar balls.
  149. </VarListEntry>
  150. <VarListEntry><Term>build-dep</Term>
  151. <ListItem><Para>
  152. <literal/build-dep/ causes apt-get to install/remove packages in an
  153. attempt to satisfy the build dependencies for a source packages. Right
  154. now virtual package build depends choose a package at random.
  155. </VarListEntry>
  156. <VarListEntry><Term>check</Term>
  157. <ListItem><Para>
  158. <literal/check/ is a diagnostic tool; it updates the package cache and checks
  159. for broken dependencies.
  160. </VarListEntry>
  161. <VarListEntry><Term>clean</Term>
  162. <ListItem><Para>
  163. <literal/clean/ clears out the local repository of retrieved package
  164. files. It removes everything but the lock file from
  165. <filename>&cachedir;/archives/</> and
  166. <filename>&cachedir;/archive/partial/</>. When APT is used as a
  167. &dselect; method, <literal/clean/ is run automatically.
  168. Those who do not use dselect will likely want to run <literal/apt-get clean/
  169. from time to time to free up disk space.
  170. </VarListEntry>
  171. <VarListEntry><Term>autoclean</Term>
  172. <ListItem><Para>
  173. Like <literal/clean/, <literal/autoclean/ clears out the local
  174. repository of retrieved package files. The difference is that it only
  175. removes package files that can no longer be downloaded, and are largely
  176. useless. This allows a cache to be maintained over a long period without
  177. it growing out of control. The configuration option
  178. <literal/APT::Clean-Installed/ will prevent installed packages from being
  179. erased if it is set off.
  180. </VarListEntry>
  181. </VariableList>
  182. </RefSect1>
  183. <RefSect1><Title>Options</>
  184. &apt-cmdblurb;
  185. <VariableList>
  186. <VarListEntry><term><option/-d/</><term><option/--download-only/</>
  187. <ListItem><Para>
  188. Download only; package files are only retrieved, not unpacked or installed.
  189. Configuration Item: <literal/APT::Get::Download-Only/.
  190. </VarListEntry>
  191. <VarListEntry><term><option/-f/</><term><option/--fix-broken/</>
  192. <ListItem><Para>
  193. Fix; attempt to correct a system with broken dependencies in
  194. place. This option, when used with install/remove, can omit any packages
  195. to permit APT to deduce a likely soltion. Any Package that are specified
  196. must completly correct the problem. The option is sometimes necessary when
  197. running APT for the first time; APT itself does not allow broken package
  198. dependencies to exist on a system. It is possible that a system's
  199. dependency structure can be so corrupt as to require manual intervention
  200. (which usually means using &dselect; or <command/dpkg --remove/ to eliminate some of
  201. the offending packages). Use of this option together with <option/-m/ may produce an
  202. error in some situations.
  203. Configuration Item: <literal/APT::Get::Fix-Broken/.
  204. </VarListEntry>
  205. <VarListEntry><term><option/-m/</><term><option/--ignore-missing/</>
  206. <term><option/--fix-missing/</>
  207. <ListItem><Para>
  208. Ignore missing packages; If packages cannot be retrieved or fail the
  209. integrity check after retrieval (corrupted package files), hold back
  210. those packages and handle the result. Use of this option together with
  211. <option/-f/ may produce an error in some situations. If a package is
  212. selected for installation (particularly if it is mentioned on the
  213. command line) and it could not be downloaded then it will be silently
  214. held back.
  215. Configuration Item: <literal/APT::Get::Fix-Missing/.
  216. </VarListEntry>
  217. <VarListEntry><term><option/--no-download/</>
  218. <ListItem><Para>
  219. Disables downloading of packages. This is best used with
  220. <option/--ignore-missing/ to force APT to use only the .debs it has
  221. already downloaded.
  222. Configuration Item: <literal/APT::Get::Download/.
  223. </VarListEntry>
  224. <VarListEntry><term><option/-q/</><term><option/--quiet/</>
  225. <ListItem><Para>
  226. Quiet; produces output suitable for logging, omitting progress indicators.
  227. More q's will produce more quiet up to a maximum of 2. You can also use
  228. <option/-q=#/ to set the quiet level, overriding the configuration file.
  229. Note that quiet level 2 implies <option/-y/, you should never use -qq
  230. without a no-action modifier such as -d, --print-uris or -s as APT may
  231. decided to do something you did not expect.
  232. Configuration Item: <literal/quiet/.
  233. </VarListEntry>
  234. <VarListEntry><term><option/-s/</>
  235. <term><option/--simulate/</>
  236. <term><option/--just-print/</>
  237. <term><option/--dry-run/</>
  238. <term><option/--recon/</>
  239. <term><option/--no-act/</>
  240. <ListItem><Para>
  241. No action; perform a simulation of events that would occur but do not
  242. actually change the system.
  243. Configuration Item: <literal/APT::Get::Simulate/.
  244. <para>
  245. Simulate prints out
  246. a series of lines each one representing a dpkg operation, Configure (Conf),
  247. Remove (Remv), Unpack (Inst). Square brackets indicate broken packages with
  248. and empty set of square brackets meaning breaks that are of no consequence
  249. (rare).
  250. </VarListEntry>
  251. <VarListEntry><term><option/-y/</><term><option/--yes/</>
  252. <term><option/--assume-yes/</>
  253. <ListItem><Para>
  254. Automatic yes to prompts; assume "yes" as answer to all prompts and run
  255. non-interactively. If an undesirable situation, such as changing a held
  256. package or removing an essential package occurs then <literal/apt-get/
  257. will abort.
  258. Configuration Item: <literal/APT::Get::Assume-Yes/.
  259. </VarListEntry>
  260. <VarListEntry><term><option/-u/</><term><option/--show-upgraded/</>
  261. <ListItem><Para>
  262. Show upgraded packages; Print out a list of all packages that are to be
  263. upgraded.
  264. Configuration Item: <literal/APT::Get::Show-Upgraded/.
  265. </VarListEntry>
  266. <VarListEntry><term><option/-b/</><term><option/--compile/</>
  267. <term><option/--build/</>
  268. <ListItem><Para>
  269. Compile source packages after downloading them.
  270. Configuration Item: <literal/APT::Get::Compile/.
  271. </VarListEntry>
  272. <VarListEntry><term><option/--ignore-hold/</>
  273. <ListItem><Para>
  274. Ignore package Holds; This causes <command/apt-get/ to ignore a hold
  275. placed on a package. This may be useful in conjunction with
  276. <literal/dist-upgrade/ to override a large number of undesired holds.
  277. Configuration Item: <literal/APT::Ignore-Hold/.
  278. </VarListEntry>
  279. <VarListEntry><term><option/--no-upgrade/</>
  280. <ListItem><Para>
  281. Do not upgrade packages; When used in conjunction with <literal/install/
  282. <literal/no-upgrade/ will prevent packages listed from being upgraded
  283. if they are already installed.
  284. Configuration Item: <literal/APT::Get::Upgrade/.
  285. </VarListEntry>
  286. <VarListEntry><term><option/--force-yes/</>
  287. <ListItem><Para>
  288. Force yes; This is a dangerous option that will cause apt to continue
  289. without prompting if it is doing something potentially harmful. It
  290. should not be used except in very special situations. Using
  291. <literal/force-yes/ can potentially destroy your system!
  292. Configuration Item: <literal/APT::Get::force-yes/.
  293. </VarListEntry>
  294. <VarListEntry><term><option/--print-uris/</>
  295. <ListItem><Para>
  296. Instead of fetching the files to install their URIs are printed. Each
  297. URI will have the path, the destination file name, the size and the expected
  298. md5 hash. Note that the file name to write to will not always match
  299. the file name on the remote site! This also works with the /source/
  300. command. Configuration Item: <literal/APT::Get::Print-URIs/.
  301. </VarListEntry>
  302. <VarListEntry><term><option/--purge/</>
  303. <ListItem><Para>
  304. Use purge instead of remove for anything that would be removed.
  305. Configuration Item: <literal/APT::Get::Purge/.
  306. </VarListEntry>
  307. <VarListEntry><term><option/--reinstall/</>
  308. <ListItem><Para>
  309. Re-Install packages that are already installed and at the newest version.
  310. Configuration Item: <literal/APT::Get::ReInstall/.
  311. </VarListEntry>
  312. <VarListEntry><term><option/--list-cleanup/</>
  313. <ListItem><Para>
  314. This option defaults to on, use <literal/--no-list-cleanup/ to turn it
  315. off. When on <command/apt-get/ will automatically manage the contents of
  316. <filename>&statedir;/lists</> to ensure that obsolete files are erased.
  317. The only reason to turn it off is if you frequently change your source
  318. list.
  319. Configuration Item: <literal/APT::Get::List-Cleanup/.
  320. </VarListEntry>
  321. <VarListEntry><term><option/-t/</>
  322. <term><option/--target-release/</>
  323. <term><option/--default-release/</>
  324. <ListItem><Para>
  325. This option controls the default input to the policy engine, it creates
  326. a default pin at priority 990 using the specified release string. The
  327. preferences file may further override this setting. In short, this option
  328. lets you have simple control over which distribution packages will be
  329. retrieved from. Some common examples might be
  330. <option>-t '2.1*'</> or <option>-t unstable</>.
  331. Configuration Item: <literal/APT::Default-Release/
  332. </VarListEntry>
  333. <VarListEntry><term><option/--trivial-only/</>
  334. <ListItem><Para>
  335. Only perform operations that are 'trivial'. Logically this can be considered
  336. related to <option/--assume-yes/, where <option/--assume-yes/ will answer
  337. yes to any prompt, <option/--trivial-only/ will answer no.
  338. Configuration Item: <literal/APT::Get::Trivial-Only/.
  339. </VarListEntry>
  340. <VarListEntry><term><option/--no-remove/</>
  341. <ListItem><Para>
  342. If any packages are to be removed apt-get immediately aborts without
  343. prompting.
  344. Configuration Item: <literal/APT::Get::Remove/
  345. </VarListEntry>
  346. <VarListEntry><term><option/--only-source/</>
  347. <ListItem><Para>
  348. Only has meaning for the <literal/source/ command. indicates that the
  349. given source names are not to be mapped through the binary table.
  350. Configuration Item: <literal/APT::Get::Only-Source/
  351. </VarListEntry>
  352. <VarListEntry><term><option/--diff-only/</><term><option/--tar-only/</>
  353. <ListItem><Para>
  354. Download only the diff or tar file of a source archive.
  355. Configuration Item: <literal/APT::Get::Diff-Only/ and
  356. <literal/APT::Get::Tar-Only/
  357. </VarListEntry>
  358. <VarListEntry><term><option/--arch-only/</>
  359. <ListItem><Para>
  360. Only process architecture-dependent build-dependencies.
  361. Configuration Item: <literal/APT::Get::Arch-Only/
  362. </VarListEntry>
  363. &apt-commonoptions;
  364. </VariableList>
  365. </RefSect1>
  366. <RefSect1><Title>Files</>
  367. <variablelist>
  368. <VarListEntry><term><filename>/etc/apt/sources.list</></term>
  369. <ListItem><Para>
  370. locations to fetch packages from.
  371. Configuration Item: <literal/Dir::Etc::SourceList/.
  372. </VarListEntry>
  373. <VarListEntry><term><filename>/etc/apt/apt.conf</></term>
  374. <ListItem><Para>
  375. APT configuration file.
  376. Configuration Item: <literal/Dir::Etc::Main/.
  377. </VarListEntry>
  378. <VarListEntry><term><filename>/etc/apt/apt.conf.d/</></term>
  379. <ListItem><Para>
  380. APT configuration file fragments
  381. Configuration Item: <literal/Dir::Etc::Parts/.
  382. </VarListEntry>
  383. <VarListEntry><term><filename>/etc/apt/preferences</></term>
  384. <ListItem><Para>
  385. version preferences file
  386. Configuration Item: <literal/Dir::Etc::Preferences/.
  387. </VarListEntry>
  388. <VarListEntry><term><filename>&cachedir;/archives/</></term>
  389. <ListItem><Para>
  390. storage area for retrieved package files.
  391. Configuration Item: <literal/Dir::Cache::Archives/.
  392. </VarListEntry>
  393. <VarListEntry><term><filename>&cachedir;/archives/partial/</></term>
  394. <ListItem><Para>
  395. storage area for package files in transit.
  396. Configuration Item: <literal/Dir::Cache::Archives/ (implicit partial).
  397. </VarListEntry>
  398. <VarListEntry><term><filename>&statedir;/lists/</></term>
  399. <ListItem><Para>
  400. storage area for state information for each package resource specified in
  401. &sources-list;
  402. Configuration Item: <literal/Dir::State::Lists/.
  403. </VarListEntry>
  404. <VarListEntry><term><filename>&statedir;/lists/partial/</></term>
  405. <ListItem><Para>
  406. storage area for state information in transit.
  407. Configuration Item: <literal/Dir::State::Lists/ (implicit partial).
  408. </VarListEntry>
  409. </variablelist>
  410. </RefSect1>
  411. <RefSect1><Title>See Also</>
  412. <para>
  413. &apt-cache;, &apt-cdrom;, &dpkg;, &dselect;, &sources-list;, &apt-conf;,
  414. The APT users guide in &docdir;, &apt-preferences;.
  415. </RefSect1>
  416. <RefSect1><Title>Diagnostics</>
  417. <para>
  418. <command/apt-get/ returns zero on normal operation, decimal 100 on error.
  419. </RefSect1>
  420. &manbugs;
  421. &manauthor;
  422. </refentry>