[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to pin certain packages from experimental?



On Sat, Mar 26, 2005 at 07:28:51AM +0100, Marc Haber wrote:
> On Tue, 22 Mar 2005 02:21:39 +1100, Paul.Hampson@anu.edu.au (Paul
> Hampson) wrote:
> >On Mon, Mar 21, 2005 at 12:36:52PM +0100, Marc Haber wrote:
> >> On Mon, 21 Mar 2005 08:47:22 +0100, Adeodato Simó <asp16@alu.ua.es>
> >> wrote:
> >> >* Marc Haber [Mon, 21 Mar 2005 08:03:21 +0100]:

> >> >> |Package: *
> >> >> |Pin: release o=Debian,a=experimental
> >> >> |Pin-Priority: -12

> >> >> |Package: exim4-daemon-light
> >> >> |Pin: release o=Debian,a=experimental
> >> >> |Pin-Priority: 555

> >> >> |  Version Table:
> >> >> |     4.50-4 555
> >> >> |        500 http://debian.debian.zugschlus.de sid/main Packages
> >> >> | *** 4.50-1 555
> >> >> |        100 /var/lib/dpkg/status
> >> >> |     4.44-2 555
> >> >> |        500 http://debian.debian.zugschlus.de sarge/main Packages
> >> >> |[2/502]mh@lefler:~$   

> >> >> available versions (4.44-2, 4.50-1 and 4.50-4) are pinned to priority
> >> >> 555.

> >> >> And I see that the pin is somewhat wrong, as the 555 pin should only
> >> >> apply to packages available from the experimental distribution and not
> >> >> to sarge and sid.

> >> >  The priority of each version/location is the number at the left of it,
> >> >  in this case, 500, 100, 500. Those numbers are correct.

> >> So you're basically saying that my pin doesn't work at all?

> >Well, the above output doesn't show a version in experimental...

> When 4.50-1 was installed on the system in question. there was 4.50-1
> in experimental. 4.50-2 went to unstable and thus 4.50-1 was
> automatically removed from experimental.

> >"How APT Interprets Priorities" in apt-preferences(5) seems to suggest
> >that a '500' priority won't be upgraded automatically, that's the
> >priority assigned to non-target distribution packages:

> The previous 4.44 version on the system was updated to 4.50-1 from
> experimental while the 500 pin was in place.

Yeah, ignore that. That was the manpage explaining the _result_ of it's default
preference assignments, but under the assumption that you have a target
distribution set.

555 next to the version number appears to be the priority of the pin on that
package.

In fact, I finally gave in, and copied your pin preference into my apt
preferences file.

Basically, with my 990 pin (ie. target distribution), I get:
exim4-daemon-light:
  Installed: (none)
  Candidate: 4.50-4
  Package Pin: (not found)
  Version Table:
     4.50-4 555
        990 http://192.168.0.1 sid/main Packages

And without my 990 pin I get:
exim4-daemon-light:
  Installed: (none)
  Candidate: (none)
  Package Pin: (not found)
  Version Table:
     4.50-4 555
        500 http://192.168.0.1 sid/main Packages

Which is the same behaviour you're seeing. In short, a package pin will select
_no package_ ahead of all available packages if it is pinned higher.

This seems a weird choice to make, as it makes what you're trying to do ("grab
any version of this package from experimental if it's higher than the one in
unstable, but track unstable otherwise") actually impossible.

Basically, the process as far as I can tell is:
Ignore packages that don't meat version criteria supplied
Ignore packages lower versioned than current, unless priority > 1000
Install highest priority remaining package
In case of priority tie, take pinned package <== This step is the issue here
	Possibly this step should be skipped if the pin doesn't match anything.
In case of no pinned package, take highest version

So pin your experimental package _below_ your target distribution (eg. 450 for
your current setup, 900 if you set a target distribution) and then apt-get
install the package from experimental. The apt will track the package in
experimental as long as it stays higher-versioned than the one in unstable.

In my case, I'm doing the opposite. "Don't grab packages from
non-Debian/unstable distros unless needed to fufill a dependancy that can't be
matched from Debian unstable, or I specifically apt-get it. Then track that
repository" so pinning Debian Unstable/main to 990, experimental and the rest
of Debian Unstable to 900, and letting everything else fall to 500 works well
for me.

> >Try setting sid (or sarge) as your target distribution, and 4.50-4
> >should rise to 990, and be auto-upgraded. However, this means your
> >experimental pin for this package is too low, and needs to be "990 < P
> ><=1000" to get the effect of "If there's a newer one in experimental,
> >grab it".

> Hm. What distribution does apt take as target distribution if none is
> set in /etc/apt/apt.conf.d?

No distribution is treated as the target distribution in that case,
everything gets 500 by default.

> Shouldn't installation set a target release automatically? Why don't
> I have a target release set?

Because unless you play with pinning, the target release isn't
interesting, you're assumed to want the latest version of a package
that shows up in your available lists.

> >The upshot here (and the same lesson I learnt futzing with apt-pinning)
> >is: Set a target release, or it won't do what you expect. ^_^

> I see. I expected that to happen automatically.

See? ^_^

> >Or at the very least, (if for example you use other archives that
> >also claim to be unstable, and you only want to fall back on them
> >if Debian/unstable doesn't have what you need:)

> >Package: *
> >Pin: release o=Debian,a=Unstable,c=main
> >Pin-Priority: 990

> >Which is roughly the same as picking a target release, but doesn't
> >give 990 to non-Debian archives marked Unstable.

> I see.

Good. ^_^ I hope that helps.

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, MCSE
8th year CompSci/Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson@Anu.edu.au

"No survivors? Then where do the stories come from I wonder?"
-- Capt. Jack Sparrow, "Pirates of the Caribbean"

This email is licensed to the recipient for non-commercial
use, duplication and distribution.
-----------------------------------------------------------

Attachment: pgpuwB8spgAHw.pgp
Description: PGP signature


Reply to: