apt pinning when two packages have very similar version numbers

0

I have a precise installation, but I am also getting packages from quantal and raring. My problem is with the linux-image-* packages.

I want to run the 3.5 kernel, and to keep track of the latest kernel in that series I want linux-image-generic from quantal. It wants to install linux-image-3.5.0-xx-generic and linux-image-extra-3.5.0-xx-generic. So far so good.

My problem is that precise-updates also contains a linux-image-3.5.0-xx-generic with the same version number plus an added ~precise1. This one is not compatible with linux-image-extras-3.5.0-xx-generic, because the package layouts in precise and quantal are different -- quantal splits the modules into a main package and an -extras package, but in precise there's only one big main package.

Now, I have tried pinning kernels to quantal with these lines:

Package: linux-image-3.5*
Pin: release n=quantal
Pin-Priority: 600

Package: linux-image-generic
Pin: release n=quantal
Pin-Priority: 600

I thought this would have solved the problem and prioritized e.g. quantal's 3.5.0-21.32 over precise's 3.5.0-21.32~precise1. But it seems that the pinning in fact finally resolves to versions, not archives (the Pin seems to be merely a filter for selecting a version number), and these two versions are considered in some sense the same version. In the end, it always prefers the wrong package.

$ apt-cache policy linux-image-3.5.0-21-generic
linux-image-3.5.0-21-generic:
  Installed: (none)
  Candidate: 3.5.0-21.32~precise1
  Package pin: 3.5.0-21.32
  Version table:
     3.5.0-21.32 600
        500 http://hk.archive.ubuntu.com/ubuntu/ quantal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ quantal-security/main amd64 Packages
     3.5.0-21.32~precise1 600
        990 http://hk.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        990 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages

Even if a provide a specific Pin for precise and set it to, say -1, the precise package "hijacks" the quantal package's pinning.

Am I guessing correctly what's behind this confusion? Is there any way to fix this, or am I going to have to literally specify apt-get install linux-image-3.5.0-21-generic/quantal* every time, like I do now to work around this? This makes the use of the meta-package slightly useless, merely a lookup mechanism for a manual install.

Of course, removing precise-updates from the equation would work, but then I would prefer continuing to specify the archive.

* Why does this work, when the pinning doesn't? I thought they both used the same mechanism -- that the /blah temporarily sets prio 990 for a particular version. Odd.

clacke

Posted 2012-12-21T08:30:39.800

Reputation: 218

Answers

0

It seems the best workaround is to run apt-get -t quantal install linux-image-generic. The -t priority setting seems to work differently than the pinning preferences are able to, and correctly picks the quantal version over the precise version.

clacke

Posted 2012-12-21T08:30:39.800

Reputation: 218