8

I've got the following pinnings set:

Package: linux-image-amd64
Pin: release a=wheezy-backports
Pin-Priority: 1001

Package: *
Pin: release a=wheezy-backports
Pin-Priority: 499

I get the following error:

$ sudo apt-get install linux-image-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-image-amd64 : Depends: linux-image-3.16.0-0.bpo.4-amd64 but it is not going to   be installed
E: Unable to correct problems, you have held broken packages.

The policies seem to be correct:

$ apt-cache policy linux-image-amd64
linux-image-amd64:
  Installed: 3.2+46
  Candidate: 3.16+63~bpo70+1
  Package pin: 3.16+63~bpo70+1
  Version table:
     3.16+63~bpo70+1 1001
        499 http://ftp.nl.debian.org/debian/ wheezy-backports/main amd64 Packages
 *** 3.2+46 1001
        500 http://ftp.nl.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy linux-image-3.16.0-0.bpo.4-amd64
linux-image-3.16.0-0.bpo.4-amd64:
  Installed: (none)
  Candidate: 3.16.7-ckt4-3~bpo70+1
  Version table:
     3.16.7-ckt4-3~bpo70+1 0
        499 http://ftp.nl.debian.org/debian/ wheezy-backports/main amd64 Packages

So I don't get the error. What am I doing wrong?

I'm trying to use puppet to upgrade all Wheezy machines to the backports kernel (a reboot streak is planned), which is why I want to solve it correctly. I could manually login to all servers to run:

sudo apt-get install -t wheezy-backports linux-image-amd64

Which works, but is not as convenient.

UPDATE

As requested:

/etc/apt/preferences.d$ cat linux-image 
Package: linux-image-*
Pin: release a=wheezy-backports
Pin-Priority: 1001

Package: *
Pin: release a=wheezy-backports
Pin-Priority: 499

/etc/apt/preferences.d$ sudo apt-get update
Hit http://debian.kumina.nl wheezy-kumina Release.gpg
.
.
.
Reading package lists... Done
/etc/apt/preferences.d$ sudo apt-get install linux-image-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-image-amd64 : Depends: linux-image-3.16.0-0.bpo.4-amd64 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
/etc/apt/preferences.d$ aptitude why-not linux-image-3.16.0-0.bpo.4-amd64
Unable to find a reason to remove linux-image-3.16.0-0.bpo.4-amd64.

3 Answers 3

3
+100

Check what that package depends on and what those dependencies need as well. For example I see this for my machine:

#apt-cache  show linux-image-amd64
Package: linux-image-amd64
<snip>
Depends: linux-image-3.16.0-4-amd64

and

# apt-cache  show linux-image-3.16.0-4-amd64
Package: linux-image-3.16.0-4-amd64
<snip>
Depends: kmod | module-init-tools, linux-base (>= 3~), debconf (>= 0.5) | debconf-2.0, initramfs-tools (>= 0.110~) | linux-initramfs-tool
Pre-Depends: debconf | debconf-2.0

Check if dependencies are taken from backports as well.

5
  • That's already explained in my question...
    – Tim Stoop
    Feb 27, 2015 at 14:54
  • 1
    I don't see anything about pinning dependencies version in your question. you need to configure higher priority for packages needed for linux-image-3.16.0-0.bpo.4-amd64. check this out: Depends: kmod | module-init-tools, linux-base (>= 3~), debconf (>= 0.5) | debconf-2.0, initramfs-tools (>= 0.110~) | dracut (>= 0.40+1-1~) | linux-initramfs-tool. If you using dracut for example, Wheezy has version 020-2 0, while backports have 040+1-1 0. In thiks case you need to increase priority of Dracut package to be taken from backports as well.
    – stimur
    Feb 27, 2015 at 17:52
  • Wouldn't those be pulled in as well when I install it via 'apt-get -t wheezy-backports install linux-image-amd64'?
    – Tim Stoop
    Feb 28, 2015 at 20:05
  • 1
    It will, if you enforce it with -t wheezy-backports. But this enforcement will also install all newer versions for not installed dependencies from backports as well, regardless of fact if stable versions are enough or not. If you need to install only limited and controlled number of packages from backports, you need to track the dependencies and manually pin them. If you don't care about that, sure go ahead and do full -t *backports.
    – stimur
    Mar 1, 2015 at 2:40
  • Ah got it, you're right. I needed to fetch initramfs-tools from backports as well and then it can be done automatically. Thanks!
    – Tim Stoop
    Mar 2, 2015 at 8:51
6

sudo apt-get install -t wheezy-backports linux-image-amd64

it is not convenient I know .. but it is the right way to do things without having troubles in future (IMHO of course)

3
  • What troubles in the future would you expect with this?
    – Tim Stoop
    Feb 24, 2015 at 18:34
  • 1
    - if debian has engineered its system to work one way I "suppose" they have their good reason ;) (see backports Instructions) - pinning the entire source you give a higher priority to a wide number of packages being recompiled from testing and unstable and not tested as the stable couterparts - the philosophy using -t is to let the package to install its dependencies .. "do strictly what you need" .. - its a while list approach: do what you are aware to do, when you need
    – drAlberT
    Feb 25, 2015 at 9:37
  • 2
    This doesn't have enough upvotes Mar 11, 2016 at 15:57
1

Change the top line in your preferences to

Package: linux-image-*

Run

apt-get update

Try to install again. If you still get the error, check

aptitude why-not linux-image-3.16.0-0.bpo.4-amd64
3
  • Doesn't work. Added the command output to my question.
    – Tim Stoop
    Feb 22, 2015 at 19:31
  • OK, thanks for trying. I'd be inclined to use the aptitude resolver interactively to identify the problem. Maybe linux-* to include other dependencies? Is it feasible to add APT::Default-Release "wheezy-backports"; to the configuration temporarily? Feb 22, 2015 at 20:15
  • We actually remove aptitude from all our servers, I had to install it to do the test. So that won't be feasible. Adding the config option temporarily is not feasible and, honestly, not really a nice solution :) I'm pretty sure this should be doable with apt-get without any hacks, just can't figure out how!
    – Tim Stoop
    Feb 22, 2015 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .