apt_preferences.5.xml 24 KB

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