Re: Questions about package pinning

Panu Matilainen <[email protected]> Fri, 30 Jul 2004 16:06:00 +0300
Newsgroups gmane.linux.conectiva.apt-rpm
Message-ID <[email protected]>
On Fri, 2004-07-30 at 13:33, Andre Costa wrote:
> Hi,
> 
> I need to do some package pinning, because a couple of packages are
> breaking things around here. A practical example is cdrecord from
> kde-redhat: it breaks latest k3b and xcdroast (already filed a bug
> report for that).
> 
> So, I put this on /etc/apt/preferences based on a couple of references
> I found with Google:
> 
> Package: cdrecord
> Pin: release c=freshrpms
> Pin-Priority: 1001
> 
> And it seems to be working:
> 
> apt-cache policy cdrecord
> cdrecord:
>   Installed: 8:2.01-0.a19.2
>   Candidate: (none)
>   Package Pin: (not found)
>   Version Table:
>      8:2.01-0.fdr.5.a27.1 1001
>         500 ftp://apt.kde-redhat.org fedora/1/stable pkglist
>  *** 8:2.01-0.a19.2 1001
>         500 http://ayo.freshrpms.net fedora/linux/1/i386/core pkglist
>         100 RPM Database
> 
> (although I didn't understand why the "(not found)" for "Package
> Pin:"...)

That's because there's no version of cdrecord in "freshrpms" component.
You'll want to use

Package: cdrecord
Pin: release c=core
Pin-Priority: 1001


> The thing is: I tried to use:
> 
> Package: cdrecord
> Pin: release c=kde-redhat
> Pin-Priority: 0
> 
> And it didn't work -- apt was trying to upgrade cdrecord to latest from
> kde-redhat. My guess is that "c=kde-redhat" is wrong. Or should I have
> used Pin-Prioiry = -1?

You'll want negative pin BUT negative per-package pins don't work quite
as expected. It might work in the above case but at least if you try to
prevent a specific version of a package from installing it doesn't work.
I've a patch for the version-case at http://laiskiainen.org/apt/patches/
> 
> So, any good reference about apt pinning will be most welcome --
> specifically, I'd like to know to specify a, c, o, l, v for a specific
> package/repository?

"apt-cache policy" is the best way to see what the various parameters
are for a given repository. In many cases the repository maintainer
hasn't bothered to enter any meaningful values for most of the entries
so 'c' is generally the only reliable parameter (because it's
automatically generated)

> 
> Feel free to point me to some documentation if it is already there. I
> browsed the APT HOWTO info at
> http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html, but
> IMHO it wasn't very complete with regards to these parameters.

Yep, there's not too much documentation about the gory details of
pinning :(

	- Panu -