apt_preferences.5.xml 25 KB

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