apt-get.8.sgml 22 KB

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