apt_preferences.5.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  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 n=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. </variablelist>
  294. </para>
  295. <para>If any specific-form records match an available package version then the
  296. first such record determines the priority of the package version.
  297. Failing that,
  298. if any general-form records match an available package version then the
  299. first such record determines the priority of the package version.</para>
  300. <para>For example, suppose the APT preferences file contains the three
  301. records presented earlier:</para>
  302. <programlisting>
  303. Package: perl
  304. Pin: version &good-perl;*
  305. Pin-Priority: 1001
  306. Package: *
  307. Pin: origin ""
  308. Pin-Priority: 999
  309. Package: *
  310. Pin: release unstable
  311. Pin-Priority: 50
  312. </programlisting>
  313. <para>Then:
  314. <itemizedlist>
  315. <listitem><simpara>The most recent available version of the <literal>perl</literal>
  316. package will be installed, so long as that version's version number begins
  317. with "<literal>&good-perl;</literal>". If <emphasis>any</emphasis> &good-perl;* version of <literal>perl</literal> is
  318. available and the installed version is &bad-perl;*, then <literal>perl</literal> will be
  319. downgraded.</simpara></listitem>
  320. <listitem><simpara>A version of any package other than <literal>perl</literal>
  321. that is available from the local system has priority over other versions,
  322. even versions belonging to the target release.
  323. </simpara></listitem>
  324. <listitem><simpara>A version of a package whose origin is not the local
  325. system but some other site listed in &sources-list; and which belongs to
  326. an <literal>unstable</literal> distribution is only installed if it is selected
  327. for installation and no version of the package is already installed.
  328. </simpara></listitem>
  329. </itemizedlist>
  330. </para>
  331. </refsect2>
  332. <refsect2>
  333. <title>Determination of Package Version and Distribution Properties</title>
  334. <para>The locations listed in the &sources-list; file should provide
  335. <filename>Packages</filename> and <filename>Release</filename> files
  336. to describe the packages available at that location. </para>
  337. <para>The <filename>Packages</filename> file is normally found in the directory
  338. <filename>.../dists/<replaceable>dist-name</replaceable>/<replaceable>component</replaceable>/<replaceable>arch</replaceable></filename>:
  339. for example, <filename>.../dists/stable/main/binary-i386/Packages</filename>.
  340. It consists of a series of multi-line records, one for each package available
  341. in that directory. Only two lines in each record are relevant for setting
  342. APT priorities:
  343. <variablelist>
  344. <varlistentry>
  345. <term>the <literal>Package:</literal> line</term>
  346. <listitem><simpara>gives the package name</simpara></listitem>
  347. </varlistentry>
  348. <varlistentry>
  349. <term>the <literal>Version:</literal> line</term>
  350. <listitem><simpara>gives the version number for the named package</simpara></listitem>
  351. </varlistentry>
  352. </variablelist>
  353. </para>
  354. <para>The <filename>Release</filename> file is normally found in the directory
  355. <filename>.../dists/<replaceable>dist-name</replaceable></filename>:
  356. for example, <filename>.../dists/stable/Release</filename>,
  357. or <filename>.../dists/&stable-codename;/Release</filename>.
  358. It consists of a single multi-line record which applies to <emphasis>all</emphasis> of
  359. the packages in the directory tree below its parent. Unlike the
  360. <filename>Packages</filename> file, nearly all of the lines in a <filename>Release</filename>
  361. file are relevant for setting APT priorities:
  362. <variablelist>
  363. <varlistentry>
  364. <term>the <literal>Archive:</literal> or <literal>Suite:</literal> line</term>
  365. <listitem><simpara>names the archive to which all the packages
  366. in the directory tree belong. For example, the line
  367. "Archive: stable" or
  368. "Suite: stable"
  369. specifies that all of the packages in the directory
  370. tree below the parent of the <filename>Release</filename> file are in a
  371. <literal>stable</literal> archive. Specifying this value in the APT preferences file
  372. would require the line:
  373. </simpara>
  374. <programlisting>
  375. Pin: release a=stable
  376. </programlisting>
  377. </listitem>
  378. </varlistentry>
  379. <varlistentry>
  380. <term>the <literal>Codename:</literal> line</term>
  381. <listitem><simpara>names the codename to which all the packages
  382. in the directory tree belong. For example, the line
  383. "Codename: &testing-codename;"
  384. specifies that all of the packages in the directory
  385. tree below the parent of the <filename>Release</filename> file belong to a version named
  386. <literal>&testing-codename;</literal>. Specifying this value in the APT preferences file
  387. would require the line:
  388. </simpara>
  389. <programlisting>
  390. Pin: release n=&testing-codename;
  391. </programlisting>
  392. </listitem>
  393. </varlistentry>
  394. <varlistentry>
  395. <term>the <literal>Version:</literal> line</term>
  396. <listitem><simpara>names the release version. For example, the
  397. packages in the tree might belong to Debian release
  398. version &stable-version;. Note that there is normally no version number for the
  399. <literal>testing</literal> and <literal>unstable</literal> distributions because they
  400. have not been released yet. Specifying this in the APT preferences
  401. file would require one of the following lines.
  402. </simpara>
  403. <programlisting>
  404. Pin: release v=&stable-version;
  405. Pin: release a=stable, v=&stable-version;
  406. Pin: release &stable-version;
  407. </programlisting>
  408. </listitem>
  409. </varlistentry>
  410. <varlistentry>
  411. <term>the <literal>Component:</literal> line</term>
  412. <listitem><simpara>names the licensing component associated with the
  413. packages in the directory tree of the <filename>Release</filename> file.
  414. For example, the line "Component: main" specifies that
  415. all the packages in the directory tree are from the <literal>main</literal>
  416. component, which entails that they are licensed under terms listed
  417. in the Debian Free Software Guidelines. Specifying this component
  418. in the APT preferences file would require the line:
  419. </simpara>
  420. <programlisting>
  421. Pin: release c=main
  422. </programlisting>
  423. </listitem>
  424. </varlistentry>
  425. <varlistentry>
  426. <term>the <literal>Origin:</literal> line</term>
  427. <listitem><simpara>names the originator of the packages in the
  428. directory tree of the <filename>Release</filename> file. Most commonly, this is
  429. <literal>Debian</literal>. Specifying this origin in the APT preferences file
  430. would require the line:
  431. </simpara>
  432. <programlisting>
  433. Pin: release o=Debian
  434. </programlisting>
  435. </listitem>
  436. </varlistentry>
  437. <varlistentry>
  438. <term>the <literal>Label:</literal> line</term>
  439. <listitem><simpara>names the label of the packages in the directory tree
  440. of the <filename>Release</filename> file. Most commonly, this is
  441. <literal>Debian</literal>. Specifying this label in the APT preferences file
  442. would require the line:
  443. </simpara>
  444. <programlisting>
  445. Pin: release l=Debian
  446. </programlisting>
  447. </listitem>
  448. </varlistentry>
  449. </variablelist>
  450. </para>
  451. <para>All of the <filename>Packages</filename> and <filename>Release</filename>
  452. files retrieved from locations listed in the &sources-list; file are stored
  453. in the directory <filename>/var/lib/apt/lists</filename>, or in the file named
  454. by the variable <literal>Dir::State::Lists</literal> in the <filename>apt.conf</filename> file.
  455. For example, the file
  456. <filename>debian.lcs.mit.edu_debian_dists_unstable_contrib_binary-i386_Release</filename>
  457. contains the <filename>Release</filename> file retrieved from the site
  458. <literal>debian.lcs.mit.edu</literal> for <literal>binary-i386</literal> architecture
  459. files from the <literal>contrib</literal> component of the <literal>unstable</literal>
  460. distribution.</para>
  461. </refsect2>
  462. <refsect2>
  463. <title>Optional Lines in an APT Preferences Record</title>
  464. <para>Each record in the APT preferences file can optionally begin with
  465. one or more lines beginning with the word <literal>Explanation:</literal>.
  466. This provides a place for comments.</para>
  467. </refsect2>
  468. </refsect1>
  469. <refsect1>
  470. <title>Examples</title>
  471. <refsect2>
  472. <title>Tracking Stable</title>
  473. <para>The following APT preferences file will cause APT to assign a
  474. priority higher than the default (500) to all package versions belonging
  475. to a <literal>stable</literal> distribution and a prohibitively low priority to
  476. package versions belonging to other <literal>Debian</literal> distributions.
  477. <programlisting>
  478. Explanation: Uninstall or do not install any Debian-originated
  479. Explanation: package versions other than those in the stable distro
  480. Package: *
  481. Pin: release a=stable
  482. Pin-Priority: 900
  483. Package: *
  484. Pin: release o=Debian
  485. Pin-Priority: -10
  486. </programlisting>
  487. </para>
  488. <para>With a suitable &sources-list; file and the above preferences file,
  489. any of the following commands will cause APT to upgrade to the
  490. latest <literal>stable</literal> version(s).
  491. <programlisting>
  492. apt-get install <replaceable>package-name</replaceable>
  493. apt-get upgrade
  494. apt-get dist-upgrade
  495. </programlisting>
  496. </para>
  497. <para>The following command will cause APT to upgrade the specified
  498. package to the latest version from the <literal>testing</literal> distribution;
  499. the package will not be upgraded again unless this command is given
  500. again.
  501. <programlisting>
  502. apt-get install <replaceable>package</replaceable>/testing
  503. </programlisting>
  504. </para>
  505. </refsect2>
  506. <refsect2>
  507. <title>Tracking Testing or Unstable</title>
  508. <para>The following APT preferences file will cause APT to assign
  509. a high priority to package versions from the <literal>testing</literal>
  510. distribution, a lower priority to package versions from the
  511. <literal>unstable</literal> distribution, and a prohibitively low priority
  512. to package versions from other <literal>Debian</literal> distributions.
  513. <programlisting>
  514. Package: *
  515. Pin: release a=testing
  516. Pin-Priority: 900
  517. Package: *
  518. Pin: release a=unstable
  519. Pin-Priority: 800
  520. Package: *
  521. Pin: release o=Debian
  522. Pin-Priority: -10
  523. </programlisting>
  524. </para>
  525. <para>With a suitable &sources-list; file and the above preferences file,
  526. any of the following commands will cause APT to upgrade to the latest
  527. <literal>testing</literal> version(s).
  528. <programlisting>
  529. apt-get install <replaceable>package-name</replaceable>
  530. apt-get upgrade
  531. apt-get dist-upgrade
  532. </programlisting>
  533. </para>
  534. <para>The following command will cause APT to upgrade the specified
  535. package to the latest version from the <literal>unstable</literal> distribution.
  536. Thereafter, <command>apt-get upgrade</command> will upgrade
  537. the package to the most recent <literal>testing</literal> version if that is
  538. more recent than the installed version, otherwise, to the most recent
  539. <literal>unstable</literal> version if that is more recent than the installed
  540. version.
  541. <programlisting>
  542. apt-get install <replaceable>package</replaceable>/unstable
  543. </programlisting>
  544. </para>
  545. </refsect2>
  546. <refsect2>
  547. <title>Tracking the evolution of a codename release</title>
  548. <para>The following APT preferences file will cause APT to assign a
  549. priority higher than the default (500) to all package versions belonging
  550. to a specified codename of a distribution and a prohibitively low priority to
  551. package versions belonging to other <literal>Debian</literal> distributions,
  552. codenames and archives.
  553. Note that with this APT preference APT will follow the migration of a release
  554. from the archive <literal>testing</literal> to <literal>stable</literal> and
  555. later <literal>oldstable</literal>. If you want to follow for example the progress
  556. in <literal>testing</literal> notwithstanding the codename changes you should use
  557. the example configurations above.
  558. <programlisting>
  559. Explanation: Uninstall or do not install any Debian-originated package versions
  560. Explanation: other than those in the distribution codenamed with &testing-codename; or sid
  561. Package: *
  562. Pin: release n=&testing-codename;
  563. Pin-Priority: 900
  564. Explanation: Debian unstable is always codenamed with sid
  565. Package: *
  566. Pin: release n=sid
  567. Pin-Priority: 800
  568. Package: *
  569. Pin: release o=Debian
  570. Pin-Priority: -10
  571. </programlisting>
  572. </para>
  573. <para>With a suitable &sources-list; file and the above preferences file,
  574. any of the following commands will cause APT to upgrade to the
  575. latest version(s) in the release codenamed with <literal>&testing-codename;</literal>.
  576. <programlisting>
  577. apt-get install <replaceable>package-name</replaceable>
  578. apt-get upgrade
  579. apt-get dist-upgrade
  580. </programlisting>
  581. </para>
  582. <para>The following command will cause APT to upgrade the specified
  583. package to the latest version from the <literal>sid</literal> distribution.
  584. Thereafter, <command>apt-get upgrade</command> will upgrade
  585. the package to the most recent <literal>&testing-codename;</literal> version if that is
  586. more recent than the installed version, otherwise, to the most recent
  587. <literal>sid</literal> version if that is more recent than the installed
  588. version.
  589. <programlisting>
  590. apt-get install <replaceable>package</replaceable>/sid
  591. </programlisting>
  592. </para>
  593. </refsect2>
  594. </refsect1>
  595. <refsect1>
  596. <title>Files</title>
  597. <variablelist>
  598. &file-preferences;
  599. </variablelist>
  600. </refsect1>
  601. <refsect1>
  602. <title>See Also</title>
  603. <para>&apt-get; &apt-cache; &apt-conf; &sources-list;
  604. </para>
  605. </refsect1>
  606. &manbugs;
  607. </refentry>