apt_preferences.5.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % aptent SYSTEM "apt.ent"> %aptent;
  5. <!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent"> %aptverbatiment;
  6. <!ENTITY % aptvendor SYSTEM "apt-vendor.ent"> %aptvendor;
  7. ]>
  8. <refentry>
  9. <refentryinfo>
  10. &apt-author.team;
  11. &apt-email;
  12. &apt-product;
  13. <!-- The last update date -->
  14. <date>2012-06-09T00:00:00Z</date>
  15. </refentryinfo>
  16. <refmeta>
  17. <refentrytitle>apt_preferences</refentrytitle>
  18. <manvolnum>5</manvolnum>
  19. <refmiscinfo class="manual">APT</refmiscinfo>
  20. </refmeta>
  21. <!-- Man page title -->
  22. <refnamediv>
  23. <refname>apt_preferences</refname>
  24. <refpurpose>Preference control file for APT</refpurpose>
  25. </refnamediv>
  26. <refsect1>
  27. <title>Description</title>
  28. <para>The APT preferences file <filename>/etc/apt/preferences</filename>
  29. and the fragment files in the <filename>/etc/apt/preferences.d/</filename>
  30. folder can be used to control which versions of packages will be selected
  31. for installation.</para>
  32. <para>Several versions of a package may be available for installation when
  33. the &sources-list; file contains references to more than one distribution
  34. (for example, <literal>stable</literal> and <literal>testing</literal>).
  35. APT assigns a priority to each version that is available.
  36. Subject to dependency constraints, <command>apt-get</command> selects the
  37. version with the highest priority for installation.
  38. The APT preferences override the priorities that APT assigns to
  39. package versions by default, thus giving the user control over which
  40. one is selected for installation.</para>
  41. <para>Several instances of the same version of a package may be available when
  42. the &sources-list; file contains references to more than one source.
  43. In this case <command>apt-get</command> downloads the instance listed
  44. earliest in the &sources-list; file.
  45. The APT preferences do not affect the choice of instance, only
  46. the choice of version.</para>
  47. <para>Preferences are a strong power in the hands of a system administrator
  48. but they can become also their biggest nightmare if used without care!
  49. APT will not question the preferences, so wrong settings can
  50. lead to uninstallable packages or wrong decisions while upgrading packages.
  51. Even more problems will arise if multiple distribution releases are mixed
  52. without a good understanding of the following paragraphs.
  53. Packages included in a specific release aren't tested in (and
  54. therefore don't always work as expected in) older or newer releases, or
  55. together with other packages from different releases.
  56. You have been warned.</para>
  57. <para>Note that the files in the <filename>/etc/apt/preferences.d</filename>
  58. directory are parsed in alphanumeric ascending order and need to obey the
  59. following naming convention: The files have either no or "<literal>pref</literal>"
  60. as filename extension and only contain alphanumeric, hyphen (-),
  61. underscore (_) and period (.) characters.
  62. Otherwise APT will print a notice that it has ignored a file, unless that
  63. file matches a pattern in the <literal>Dir::Ignore-Files-Silently</literal>
  64. configuration list - in which case it will be silently ignored.</para>
  65. <refsect2><title>APT's Default Priority Assignments</title>
  66. <para>If there is no preferences file or if there is no entry in the file
  67. that applies to a particular version then the priority assigned to that
  68. version is the priority of the distribution to which that version
  69. belongs. It is possible to single out a distribution, "the target release",
  70. which receives a higher priority than other distributions do by default.
  71. The target release can be set on the <command>apt-get</command> command
  72. line or in the APT configuration file <filename>/etc/apt/apt.conf</filename>.
  73. Note that this has precedence over any general priority you set in the
  74. <filename>/etc/apt/preferences</filename> file described later, but not
  75. over specifically pinned packages.
  76. For example,
  77. <programlisting>
  78. <command>apt-get install -t testing <replaceable>some-package</replaceable></command>
  79. </programlisting>
  80. <programlisting>
  81. APT::Default-Release "stable";
  82. </programlisting>
  83. </para>
  84. <para>If the target release has been specified then APT uses the following
  85. algorithm to set the priorities of the versions of a package. Assign:
  86. <variablelist>
  87. <varlistentry>
  88. <term>priority 1</term>
  89. <listitem><simpara>to the versions coming from archives which in their <filename>Release</filename>
  90. files are marked as "NotAutomatic: yes" but <emphasis>not</emphasis> as "ButAutomaticUpgrades: yes"
  91. like the Debian <literal>experimental</literal> archive.</simpara></listitem>
  92. </varlistentry>
  93. <varlistentry>
  94. <term>priority 100</term>
  95. <listitem><simpara>to the version that is already installed (if any) and to the versions coming
  96. from archives which in their <filename>Release</filename> files are marked as "NotAutomatic: yes" and
  97. "ButAutomaticUpgrades: yes" like the Debian backports archive since <literal>squeeze-backports</literal>.
  98. </simpara></listitem>
  99. </varlistentry>
  100. <varlistentry>
  101. <term>priority 500</term>
  102. <listitem><simpara>to the versions that are not installed and do not belong to the target release.</simpara></listitem>
  103. </varlistentry>
  104. <varlistentry>
  105. <term>priority 990</term>
  106. <listitem><simpara>to the versions that are not installed and belong to the target release.</simpara></listitem>
  107. </varlistentry>
  108. </variablelist>
  109. </para>
  110. <para>If the target release has not been specified then APT simply assigns
  111. priority 100 to all installed package versions and priority 500 to all
  112. uninstalled package versions, except versions coming from archives which
  113. in their <filename>Release</filename> files are marked as "NotAutomatic: yes" -
  114. these versions get the priority 1 or priority 100 if it is additionally marked
  115. as "ButAutomaticUpgrades: yes".</para>
  116. <para>APT then applies the following rules, listed in order of precedence,
  117. to determine which version of a package to install.
  118. <itemizedlist>
  119. <listitem><simpara>Never downgrade unless the priority of an available
  120. version exceeds 1000. ("Downgrading" is installing a less recent version
  121. of a package in place of a more recent version. Note that none of APT's
  122. default priorities exceeds 1000; such high priorities can only be set in
  123. the preferences file. Note also that downgrading a package
  124. can be risky.)</simpara></listitem>
  125. <listitem><simpara>Install the highest priority version.</simpara></listitem>
  126. <listitem><simpara>If two or more versions have the same priority,
  127. install the most recent one (that is, the one with the higher version
  128. number).</simpara></listitem>
  129. <listitem><simpara>If two or more versions have the same priority and
  130. version number but either the packages differ in some of their metadata or the
  131. <literal>--reinstall</literal> option is given, install the uninstalled one.</simpara></listitem>
  132. </itemizedlist>
  133. </para>
  134. <para>In a typical situation, the installed version of a package (priority 100)
  135. is not as recent as one of the versions available from the sources listed in
  136. the &sources-list; file (priority 500 or 990). Then the package will be upgraded
  137. when <command>apt-get install <replaceable>some-package</replaceable></command>
  138. or <command>apt-get upgrade</command> is executed.
  139. </para>
  140. <para>More rarely, the installed version of a package is <emphasis>more</emphasis> recent
  141. than any of the other available versions. The package will not be downgraded
  142. when <command>apt-get install <replaceable>some-package</replaceable></command>
  143. or <command>apt-get upgrade</command> is executed.</para>
  144. <para>Sometimes the installed version of a package is more recent than the
  145. version belonging to the target release, but not as recent as a version
  146. belonging to some other distribution. Such a package will indeed be upgraded
  147. when <command>apt-get install <replaceable>some-package</replaceable></command>
  148. or <command>apt-get upgrade</command> is executed,
  149. because at least <emphasis>one</emphasis> of the available versions has a higher
  150. priority than the installed version.</para>
  151. </refsect2>
  152. <refsect2><title>The Effect of APT Preferences</title>
  153. <para>The APT preferences file allows the system administrator to control the
  154. assignment of priorities. The file consists of one or more multi-line records
  155. separated by blank lines. Records can have one of two forms, a specific form
  156. and a general form.
  157. <itemizedlist>
  158. <listitem>
  159. <simpara>The specific form assigns a priority (a "Pin-Priority") to one or more
  160. specified packages with a specified version or version range. For example,
  161. the following record assigns a high priority to all versions of
  162. the <filename>perl</filename> package whose version number begins with "<literal>&good-perl;</literal>".
  163. Multiple packages can be separated by spaces.</simpara>
  164. <programlisting>
  165. Package: perl
  166. Pin: version &good-perl;*
  167. Pin-Priority: 1001
  168. </programlisting>
  169. </listitem>
  170. <listitem><simpara>The general form assigns a priority to all of the package versions in a
  171. given distribution (that is, to all the versions of packages that are
  172. listed in a certain <filename>Release</filename> file) or to all of the package
  173. versions coming from a particular Internet site, as identified by the
  174. site's fully qualified domain name.</simpara>
  175. <simpara>This general-form entry in the APT preferences file applies only
  176. to groups of packages. For example, the following record assigns a high
  177. priority to all package versions available from the local site.</simpara>
  178. <programlisting>
  179. Package: *
  180. Pin: origin ""
  181. Pin-Priority: 999
  182. </programlisting>
  183. <simpara>A note of caution: the keyword used here is "<literal>origin</literal>"
  184. which can be used to match a hostname. The following record will assign a high priority
  185. to all versions available from the server identified by the hostname "ftp.de.debian.org"</simpara>
  186. <programlisting>
  187. Package: *
  188. Pin: origin "ftp.de.debian.org"
  189. Pin-Priority: 999
  190. </programlisting>
  191. <simpara>This should <emphasis>not</emphasis> be confused with the Origin of a distribution as
  192. specified in a <filename>Release</filename> file. What follows the "Origin:" tag
  193. in a <filename>Release</filename> file is not an Internet address
  194. but an author or vendor name, such as "Debian" or "Ximian".</simpara>
  195. <simpara>The following record assigns a low priority to all package versions
  196. belonging to any distribution whose Archive name is "<literal>unstable</literal>".</simpara>
  197. <programlisting>
  198. Package: *
  199. Pin: release a=unstable
  200. Pin-Priority: 50
  201. </programlisting>
  202. <simpara>The following record assigns a high priority to all package versions
  203. belonging to any distribution whose Codename is "<literal>&testing-codename;</literal>".</simpara>
  204. <programlisting>
  205. Package: *
  206. Pin: release n=&testing-codename;
  207. Pin-Priority: 900
  208. </programlisting>
  209. <simpara>The following record assigns a high priority to all package versions
  210. belonging to any release whose Archive name is "<literal>stable</literal>"
  211. and whose release Version number is "<literal>&stable-version;</literal>".</simpara>
  212. <programlisting>
  213. Package: *
  214. Pin: release a=stable, v=&stable-version;
  215. Pin-Priority: 500
  216. </programlisting>
  217. </listitem>
  218. </itemizedlist>
  219. </para>
  220. </refsect2>
  221. <refsect2><title>Regular expressions and &glob; syntax</title>
  222. <para>
  223. APT also supports pinning by &glob; expressions, and regular
  224. expressions surrounded by slashes. For example, the following
  225. example assigns the priority 500 to all packages from
  226. experimental where the name starts with gnome (as a &glob;-like
  227. expression) or contains the word kde (as a POSIX extended regular
  228. expression surrounded by slashes).
  229. </para>
  230. <programlisting>
  231. Package: gnome* /kde/
  232. Pin: release a=experimental
  233. Pin-Priority: 500
  234. </programlisting>
  235. <para>
  236. The rule for those expressions is that they can occur anywhere
  237. where a string can occur. Thus, the following pin assigns the
  238. priority 990 to all packages from a release starting with &ubuntu-codename;.
  239. </para>
  240. <programlisting>
  241. Package: *
  242. Pin: release n=&ubuntu-codename;*
  243. Pin-Priority: 990
  244. </programlisting>
  245. <para>
  246. If a regular expression occurs in a <literal>Package</literal> field,
  247. the behavior is the same as if this regular expression were replaced
  248. with a list of all package names it matches. It is undecided whether
  249. this will change in the future; thus you should always list wild-card
  250. pins first, so later specific pins override it.
  251. The pattern "<literal>*</literal>" in a Package field is not considered
  252. a &glob; expression in itself.
  253. </para>
  254. </refsect2>
  255. <refsect2>
  256. <title>How APT Interprets Priorities</title>
  257. <para>
  258. Priorities (P) assigned in the APT preferences file must be positive
  259. or negative integers. They are interpreted as follows (roughly speaking):
  260. <variablelist>
  261. <varlistentry>
  262. <term>P &gt;= 1000</term>
  263. <listitem><simpara>causes a version to be installed even if this
  264. constitutes a downgrade of the package</simpara></listitem>
  265. </varlistentry>
  266. <varlistentry>
  267. <term>990 &lt;= P &lt; 1000</term>
  268. <listitem><simpara>causes a version to be installed
  269. even if it does not come from the target release,
  270. unless the installed version is more recent</simpara></listitem>
  271. </varlistentry>
  272. <varlistentry>
  273. <term>500 &lt;= P &lt; 990</term>
  274. <listitem><simpara>causes a version to be installed
  275. unless there is a version available belonging to the target release
  276. or the installed version is more recent</simpara></listitem>
  277. </varlistentry>
  278. <varlistentry>
  279. <term>100 &lt;= P &lt; 500</term>
  280. <listitem><simpara>causes a version to be installed
  281. unless there is a version available belonging to some other
  282. distribution or the installed version is more recent</simpara></listitem>
  283. </varlistentry>
  284. <varlistentry>
  285. <term>0 &lt; P &lt; 100</term>
  286. <listitem><simpara>causes a version to be installed
  287. only if there is no installed version of the package</simpara></listitem>
  288. </varlistentry>
  289. <varlistentry>
  290. <term>P &lt; 0</term>
  291. <listitem><simpara>prevents the version from being installed</simpara></listitem>
  292. </varlistentry>
  293. <varlistentry>
  294. <term>P = 0</term>
  295. <listitem><simpara>has undefined behaviour, do not use it.</simpara></listitem>
  296. </varlistentry>
  297. </variablelist>
  298. </para>
  299. <para>
  300. The first specific-form record matching an available package version determines
  301. the priority of the package version.
  302. Failing that, the priority of the package is defined as the maximum of all
  303. priorities defined by generic-form records matching the version.
  304. Records defined using patterns in the Pin field other than "*" are treated like
  305. specific-form records.
  306. </para>
  307. <para>For example, suppose the APT preferences file contains the three
  308. records presented earlier:</para>
  309. <programlisting>
  310. Package: perl
  311. Pin: version &good-perl;*
  312. Pin-Priority: 1001
  313. Package: *
  314. Pin: origin ""
  315. Pin-Priority: 999
  316. Package: *
  317. Pin: release unstable
  318. Pin-Priority: 50
  319. </programlisting>
  320. <para>Then:
  321. <itemizedlist>
  322. <listitem><simpara>The most recent available version of the <literal>perl</literal>
  323. package will be installed, so long as that version's version number begins
  324. with "<literal>&good-perl;</literal>". If <emphasis>any</emphasis> &good-perl;* version of <literal>perl</literal> is
  325. available and the installed version is &bad-perl;*, then <literal>perl</literal> will be
  326. downgraded.</simpara></listitem>
  327. <listitem><simpara>A version of any package other than <literal>perl</literal>
  328. that is available from the local system has priority over other versions,
  329. even versions belonging to the target release.
  330. </simpara></listitem>
  331. <listitem><simpara>A version of a package whose origin is not the local
  332. system but some other site listed in &sources-list; and which belongs to
  333. an <literal>unstable</literal> distribution is only installed if it is selected
  334. for installation and no version of the package is already installed.
  335. </simpara></listitem>
  336. </itemizedlist>
  337. </para>
  338. </refsect2>
  339. <refsect2>
  340. <title>Determination of Package Version and Distribution Properties</title>
  341. <para>The locations listed in the &sources-list; file should provide
  342. <filename>Packages</filename> and <filename>Release</filename> files
  343. to describe the packages available at that location. </para>
  344. <para>The <filename>Packages</filename> file is normally found in the directory
  345. <filename>.../dists/<replaceable>dist-name</replaceable>/<replaceable>component</replaceable>/<replaceable>arch</replaceable></filename>:
  346. for example, <filename>.../dists/stable/main/binary-i386/Packages</filename>.
  347. It consists of a series of multi-line records, one for each package available
  348. in that directory. Only two lines in each record are relevant for setting
  349. APT priorities:
  350. <variablelist>
  351. <varlistentry>
  352. <term>the <literal>Package:</literal> line</term>
  353. <listitem><simpara>gives the package name</simpara></listitem>
  354. </varlistentry>
  355. <varlistentry>
  356. <term>the <literal>Version:</literal> line</term>
  357. <listitem><simpara>gives the version number for the named package</simpara></listitem>
  358. </varlistentry>
  359. </variablelist>
  360. </para>
  361. <para>The <filename>Release</filename> file is normally found in the directory
  362. <filename>.../dists/<replaceable>dist-name</replaceable></filename>:
  363. for example, <filename>.../dists/stable/Release</filename>,
  364. or <filename>.../dists/&stable-codename;/Release</filename>.
  365. It consists of a single multi-line record which applies to <emphasis>all</emphasis> of
  366. the packages in the directory tree below its parent. Unlike the
  367. <filename>Packages</filename> file, nearly all of the lines in a <filename>Release</filename>
  368. file are relevant for setting APT priorities:
  369. <variablelist>
  370. <varlistentry>
  371. <term>the <literal>Archive:</literal> or <literal>Suite:</literal> line</term>
  372. <listitem><simpara>names the archive to which all the packages
  373. in the directory tree belong. For example, the line
  374. "Archive: stable" or
  375. "Suite: stable"
  376. specifies that all of the packages in the directory
  377. tree below the parent of the <filename>Release</filename> file are in a
  378. <literal>stable</literal> archive. Specifying this value in the APT preferences file
  379. would require the line:
  380. </simpara>
  381. <programlisting>
  382. Pin: release a=stable
  383. </programlisting>
  384. </listitem>
  385. </varlistentry>
  386. <varlistentry>
  387. <term>the <literal>Codename:</literal> line</term>
  388. <listitem><simpara>names the codename to which all the packages
  389. in the directory tree belong. For example, the line
  390. "Codename: &testing-codename;"
  391. specifies that all of the packages in the directory
  392. tree below the parent of the <filename>Release</filename> file belong to a version named
  393. <literal>&testing-codename;</literal>. Specifying this value in the APT preferences file
  394. would require the line:
  395. </simpara>
  396. <programlisting>
  397. Pin: release n=&testing-codename;
  398. </programlisting>
  399. </listitem>
  400. </varlistentry>
  401. <varlistentry>
  402. <term>the <literal>Version:</literal> line</term>
  403. <listitem><simpara>names the release version. For example, the
  404. packages in the tree might belong to Debian release
  405. version &stable-version;. Note that there is normally no version number for the
  406. <literal>testing</literal> and <literal>unstable</literal> distributions because they
  407. have not been released yet. Specifying this in the APT preferences
  408. file would require one of the following lines.
  409. </simpara>
  410. <programlisting>
  411. Pin: release v=&stable-version;
  412. Pin: release a=stable, v=&stable-version;
  413. Pin: release &stable-version;
  414. </programlisting>
  415. </listitem>
  416. </varlistentry>
  417. <varlistentry>
  418. <term>the <literal>Component:</literal> line</term>
  419. <listitem><simpara>names the licensing component associated with the
  420. packages in the directory tree of the <filename>Release</filename> file.
  421. For example, the line "Component: main" specifies that
  422. all the packages in the directory tree are from the <literal>main</literal>
  423. component, which entails that they are licensed under terms listed
  424. in the Debian Free Software Guidelines. Specifying this component
  425. in the APT preferences file would require the line:
  426. </simpara>
  427. <programlisting>
  428. Pin: release c=main
  429. </programlisting>
  430. </listitem>
  431. </varlistentry>
  432. <varlistentry>
  433. <term>the <literal>Origin:</literal> line</term>
  434. <listitem><simpara>names the originator of the packages in the
  435. directory tree of the <filename>Release</filename> file. Most commonly, this is
  436. <literal>Debian</literal>. Specifying this origin in the APT preferences file
  437. would require the line:
  438. </simpara>
  439. <programlisting>
  440. Pin: release o=Debian
  441. </programlisting>
  442. </listitem>
  443. </varlistentry>
  444. <varlistentry>
  445. <term>the <literal>Label:</literal> line</term>
  446. <listitem><simpara>names the label of the packages in the directory tree
  447. of the <filename>Release</filename> file. Most commonly, this is
  448. <literal>Debian</literal>. Specifying this label in the APT preferences file
  449. would require the line:
  450. </simpara>
  451. <programlisting>
  452. Pin: release l=Debian
  453. </programlisting>
  454. </listitem>
  455. </varlistentry>
  456. </variablelist>
  457. </para>
  458. <para>All of the <filename>Packages</filename> and <filename>Release</filename>
  459. files retrieved from locations listed in the &sources-list; file are stored
  460. in the directory <filename>/var/lib/apt/lists</filename>, or in the file named
  461. by the variable <literal>Dir::State::Lists</literal> in the <filename>apt.conf</filename> file.
  462. For example, the file
  463. <filename>debian.lcs.mit.edu_debian_dists_unstable_contrib_binary-i386_Release</filename>
  464. contains the <filename>Release</filename> file retrieved from the site
  465. <literal>debian.lcs.mit.edu</literal> for <literal>binary-i386</literal> architecture
  466. files from the <literal>contrib</literal> component of the <literal>unstable</literal>
  467. distribution.</para>
  468. </refsect2>
  469. <refsect2>
  470. <title>Optional Lines in an APT Preferences Record</title>
  471. <para>Each record in the APT preferences file can optionally begin with
  472. one or more lines beginning with the word <literal>Explanation:</literal>.
  473. This provides a place for comments.</para>
  474. </refsect2>
  475. </refsect1>
  476. <refsect1>
  477. <title>Examples</title>
  478. <refsect2>
  479. <title>Tracking Stable</title>
  480. <para>The following APT preferences file will cause APT to assign a
  481. priority higher than the default (500) to all package versions belonging
  482. to a <literal>stable</literal> distribution and a prohibitively low priority to
  483. package versions belonging to other <literal>Debian</literal> distributions.
  484. <programlisting>
  485. Explanation: Uninstall or do not install any Debian-originated
  486. Explanation: package versions other than those in the stable distro
  487. Package: *
  488. Pin: release a=stable
  489. Pin-Priority: 900
  490. Package: *
  491. Pin: release o=Debian
  492. Pin-Priority: -10
  493. </programlisting>
  494. </para>
  495. <para>With a suitable &sources-list; file and the above preferences file,
  496. any of the following commands will cause APT to upgrade to the
  497. latest <literal>stable</literal> version(s).
  498. <programlisting>
  499. apt-get install <replaceable>package-name</replaceable>
  500. apt-get upgrade
  501. apt-get dist-upgrade
  502. </programlisting>
  503. </para>
  504. <para>The following command will cause APT to upgrade the specified
  505. package to the latest version from the <literal>testing</literal> distribution;
  506. the package will not be upgraded again unless this command is given
  507. again.
  508. <programlisting>
  509. apt-get install <replaceable>package</replaceable>/testing
  510. </programlisting>
  511. </para>
  512. </refsect2>
  513. <refsect2>
  514. <title>Tracking Testing or Unstable</title>
  515. <para>The following APT preferences file will cause APT to assign
  516. a high priority to package versions from the <literal>testing</literal>
  517. distribution, a lower priority to package versions from the
  518. <literal>unstable</literal> distribution, and a prohibitively low priority
  519. to package versions from other <literal>Debian</literal> distributions.
  520. <programlisting>
  521. Package: *
  522. Pin: release a=testing
  523. Pin-Priority: 900
  524. Package: *
  525. Pin: release a=unstable
  526. Pin-Priority: 800
  527. Package: *
  528. Pin: release o=Debian
  529. Pin-Priority: -10
  530. </programlisting>
  531. </para>
  532. <para>With a suitable &sources-list; file and the above preferences file,
  533. any of the following commands will cause APT to upgrade to the latest
  534. <literal>testing</literal> version(s).
  535. <programlisting>
  536. apt-get install <replaceable>package-name</replaceable>
  537. apt-get upgrade
  538. apt-get dist-upgrade
  539. </programlisting>
  540. </para>
  541. <para>The following command will cause APT to upgrade the specified
  542. package to the latest version from the <literal>unstable</literal> distribution.
  543. Thereafter, <command>apt-get upgrade</command> will upgrade
  544. the package to the most recent <literal>testing</literal> version if that is
  545. more recent than the installed version, otherwise, to the most recent
  546. <literal>unstable</literal> version if that is more recent than the installed
  547. version.
  548. <programlisting>
  549. apt-get install <replaceable>package</replaceable>/unstable
  550. </programlisting>
  551. </para>
  552. </refsect2>
  553. <refsect2>
  554. <title>Tracking the evolution of a codename release</title>
  555. <para>The following APT preferences file will cause APT to assign a
  556. priority higher than the default (500) to all package versions belonging
  557. to a specified codename of a distribution and a prohibitively low priority to
  558. package versions belonging to other <literal>Debian</literal> distributions,
  559. codenames and archives.
  560. Note that with this APT preference APT will follow the migration of a release
  561. from the archive <literal>testing</literal> to <literal>stable</literal> and
  562. later <literal>oldstable</literal>. If you want to follow for example the progress
  563. in <literal>testing</literal> notwithstanding the codename changes you should use
  564. the example configurations above.
  565. <programlisting>
  566. Explanation: Uninstall or do not install any Debian-originated package versions
  567. Explanation: other than those in the distribution codenamed with &testing-codename; or sid
  568. Package: *
  569. Pin: release n=&testing-codename;
  570. Pin-Priority: 900
  571. Explanation: Debian unstable is always codenamed with sid
  572. Package: *
  573. Pin: release n=sid
  574. Pin-Priority: 800
  575. Package: *
  576. Pin: release o=Debian
  577. Pin-Priority: -10
  578. </programlisting>
  579. </para>
  580. <para>With a suitable &sources-list; file and the above preferences file,
  581. any of the following commands will cause APT to upgrade to the
  582. latest version(s) in the release codenamed with <literal>&testing-codename;</literal>.
  583. <programlisting>
  584. apt-get install <replaceable>package-name</replaceable>
  585. apt-get upgrade
  586. apt-get dist-upgrade
  587. </programlisting>
  588. </para>
  589. <para>The following command will cause APT to upgrade the specified
  590. package to the latest version from the <literal>sid</literal> distribution.
  591. Thereafter, <command>apt-get upgrade</command> will upgrade
  592. the package to the most recent <literal>&testing-codename;</literal> version if that is
  593. more recent than the installed version, otherwise, to the most recent
  594. <literal>sid</literal> version if that is more recent than the installed
  595. version.
  596. <programlisting>
  597. apt-get install <replaceable>package</replaceable>/sid
  598. </programlisting>
  599. </para>
  600. </refsect2>
  601. </refsect1>
  602. <refsect1>
  603. <title>Files</title>
  604. <variablelist>
  605. &file-preferences;
  606. </variablelist>
  607. </refsect1>
  608. <refsect1>
  609. <title>See Also</title>
  610. <para>&apt-get; &apt-cache; &apt-conf; &sources-list;
  611. </para>
  612. </refsect1>
  613. &manbugs;
  614. </refentry>