You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

745 lines
27 KiB

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