apt_preferences.5.xml 24 KB

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