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

Re: Apt pinning.



Tim Woodall wrote: 
> Can anyone tell me exactly what this Pin line I have actually does - or
> even better point me to a webpage that has more than "if you want to do
> this use this" type of example?
> 
> (FTAOD I know that this isn't right and is inconsistent but before I
> start changing it I want to really understand what it's currently doing)
> 
> I have a local repository:
> 
> Codename: buster
> Components: main
> Date: Thu, 25 Nov 2021 19:42:12 +0000
> Description: Debs for local installing
> Label: local debs
> Origin: local debs
> Suite: oldstable
> 
> And I have a pin (which I've failed to update since bullseye became
> stable hence the a=stable)
> 
> Package: *
> Pin: release o=local debs,a=stable,n=buster,l=local debs,c=main,b=amd64
> Pin-Priority: 900

man apt_preferences  # go ahead and read it, it's well-organized

       P >= 1000
           causes a version to be installed even if this
constitutes a downgrade of the package

       990 <= P < 1000
           causes a version to be installed even if it does not
come from the target release, unless the installed version is
more recent

       500 <= P < 990
           causes a version to be installed unless there is a
version available belonging to the target release or the
installed version is more recent

       100 <= P < 500
           causes a version to be installed unless there is a
version available belonging to some other distribution or the
installed version is more
           recent

       0 < P < 100
           causes a version to be installed only if there is no
installed version of the package

       P < 0
           prevents the version from being installed

> What I want this to do is hold any package in my local repository even
> if a newer version is present in debian. My local repository has patched
> packages for various reasons - e.g.
> linphone/oldstable,now 3.12.0-3+tjw10r1 amd64 [installed]

Then 990...1000 is what you want.


> I don't even know whether the options on that Pin line are AND or ORed
> together. The example on the webpage has:
> 
>      Package: *
>      Pin: release v=2.2*,a=stable,c=main,o=Debian,l=Debian
>      Pin-Priority: 1001
> 
> When debian went from v2.2 potato to v3 woody, would this pin stop
> working? Because woody would be stable and potato oldstable at that
> point.

All the conditions must match. However, "stable" changes,
whereas "woody" does not".

> I'm trying to solve a (minor) problem I'm having during upgrades from
> buster to bullseye where I've backported make from bullseye to buster.
> So on my buster systems I have:
> make/oldstable,now 4.3-4.1+tjw10r1 amd64 [installed]
> 
> while once I've upgraded to bullseye I want to "downgrade" from my
> backported package to make 4.3-4.1 and then continue to track bullseye.

You will need a priority over 1000.

I don't recommend this, but you get to keep all the pieces.


-dsr-


Reply to: