Re: apt-pinning, strange behavior
- To: debian-user@lists.debian.org
 
- Subject: Re: apt-pinning, strange behavior
 
- From: theartloy <theartloy@zoho.com>
 
- Date: Fri, 28 Feb 2014 11:17:09 +0000
 
- Message-id: <53107035.1040203@zoho.com>
 
- In-reply-to: <87k3hkdeew.fsf@lpt00.freehck.ru>
 
- References: <28f8d241e1c1bcf2f24cb2073969ddcd@neutralite.org> <87r4bue4ly.fsf@lpt00.freehck.ru> <4dff77b2e59cff8911bd3f6c405f543f@neutralite.org> <87k3hkdeew.fsf@lpt00.freehck.ru>
 
On 10/10/13 22:06, Dmitrii Kashin wrote:
> berenger.morel@neutralite.org writes:
> 
>> In the same priority range, the package which will be installed is the
>> one with the highest priority, so it is fine to have one set of
>> package with 500 ( or I could take 600 or any other value ) for low
>> priority, and the other at 900 ( or 800 or... ), so that the version
>> with 900 will be installed against the lower one, even if the lower
>> one is more recent.
> 
> Oh... Truely? I thought differently and was sure I am right.
> 
> I just skimmed again through apt_preferences man page, but did not find
> such examples or explanations. Where's it documented?
For reference, the section in apt_preferences(5) that documents this is:
>     APT then applies the following rules, listed in order of precedence, to
>     determine which version of a package to install.
>     ·   Never downgrade unless the priority of an available version exceeds
>         1000. ("Downgrading" is installing a less recent version of a
>         package in place of a more recent version. Note that none of APT's
>         default priorities exceeds 1000; such high priorities can only be
>         set in the preferences file. Note also that downgrading a package
>         can be risky.)
>     ·   Install the highest priority version.
>     ·   If two or more versions have the same priority, install the most
>         recent one (that is, the one with the higher version number).
>     ·   If two or more versions have the same priority and version number
>         but either the packages differ in some of their metadata or the
>         --reinstall option is given, install the uninstalled one.
As you can see, it uses the priority first, and then the version number.
Reply to: