apt_preferences.5.xml 24 KB

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