Debian – Upgrading kernel on debian 8 Jessie

debiandebian-jessiedockerkernellinux-kernel

I have a Debian 8 Jessie server, and I'd like to upgrade my kernel to at least version 4, in order to use overlay fs with Docker.

My current kernel is:

$ uname -r
3.16.0-4-amd64

I followed a guide which stated to add the backports repository to the /etc/apt/sources.list file. I added this line:

deb http://httpredir.debian.org/debian jessie-backports main

I did an apt-get update and this is now the output of apt-cache search linux-image:

linux-headers-3.16.0-4-amd64 - Header files for Linux 3.16.0-4-amd64
linux-image-3.16.0-4-amd64 - Linux 3.16 for 64-bit PCs
linux-image-3.16.0-4-amd64-dbg - Debugging symbols for Linux 3.16.0-4-amd64
linux-image-amd64 - Linux for 64-bit PCs (meta-package)
linux-image-amd64-dbg - Debugging symbols for Linux amd64 configuration (meta-package)
nvidia-kernel-3.16.0-4-amd64 - NVIDIA binary kernel module for Linux 3.16.0-4-amd64
linux-headers-4.8.0-0.bpo.2-amd64 - Header files for Linux 4.8.0-0.bpo.2-amd64
linux-headers-4.8.0-0.bpo.2-rt-amd64 - Header files for Linux 4.8.0-0.bpo.2-rt-amd64
linux-headers-4.9.0-0.bpo.1-amd64 - Header files for Linux 4.9.0-0.bpo.1-amd64
linux-headers-4.9.0-0.bpo.1-rt-amd64 - Header files for Linux 4.9.0-0.bpo.1-rt-amd64
linux-image-4.8.0-0.bpo.2-amd64-dbg - Debugging symbols for Linux 4.8.0-0.bpo.2-amd64
linux-image-4.8.0-0.bpo.2-amd64-unsigned - Linux 4.8 for 64-bit PCs
linux-image-4.8.0-0.bpo.2-rt-amd64-dbg - Debugging symbols for Linux 4.8.0-0.bpo.2-rt-amd64
linux-image-4.8.0-0.bpo.2-rt-amd64-unsigned - Linux 4.8 for 64-bit PCs, PREEMPT_RT
linux-image-4.9.0-0.bpo.1-amd64-dbg - Debugging symbols for Linux 4.9.0-0.bpo.1-amd64
linux-image-4.9.0-0.bpo.1-amd64-unsigned - Linux 4.9 for 64-bit PCs
linux-image-4.9.0-0.bpo.1-rt-amd64-dbg - Debugging symbols for Linux 4.9.0-0.bpo.1-rt-amd64
linux-image-4.9.0-0.bpo.1-rt-amd64-unsigned - Linux 4.9 for 64-bit PCs, PREEMPT_RT
linux-headers-4.8.0-2-grsec-amd64 - Header files for Linux 4.8.0-2-grsec-amd64
linux-image-4.8.0-2-grsec-amd64 - Linux 4.8 for 64-bit PCs, Grsecurity protection
linux-image-grsec-amd64 - Linux image meta-package, grsec featureset
linux-image-rt-amd64 - Linux for 64-bit PCs (meta-package), PREEMPT_RT
linux-image-rt-amd64-dbg - Debugging symbols for Linux rt-amd64 configuration (meta-package)
linux-image-4.8.0-0.bpo.2-amd64 - Linux 4.8 for 64-bit PCs (signed)
linux-image-4.8.0-0.bpo.2-rt-amd64 - Linux 4.8 for 64-bit PCs, PREEMPT_RT (signed)
linux-image-4.9.0-0.bpo.1-amd64 - Linux 4.9 for 64-bit PCs (signed)
linux-image-4.9.0-0.bpo.1-rt-amd64 - Linux 4.9 for 64-bit PCs, PREEMPT_RT (signed)

The guide said to continue with

sudo apt-get install linux-image-amd64/jessie-backports

I did it, and I got this output:

$ sudo apt-get install linux-image-amd64/jessie-backports

Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '4.9+78~bpo8+1' (Debian Backports:jessie-backports [amd64]) for 'linux-image-amd64'
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-4.9.0-0.bpo.1-amd64
E: Unable to correct problems, you have held broken packages.

What should I do from here? Should I explicitly install linux-image-4.9.0-0.bpo.1-rt-amd64 instead of linux-image-amd64? If yes, should I install other packages along with it?

p.s. Does installing a new kernel automatically remove the older one or do I have to remove the older one manually?

Best Answer

I switched to the backport kernel for the same reason as you (docker). The backport kernel has dependencies on packages which are installed already, but not in a version that the backport kernel needs. The newer versions are also available in the backports repository. However, apt-get will not install dependencies automatically from the backports repo (unless configured to do so). In other words, you need to install the dependencies explicitly, together with the backport kernel.

The dependencies are

  • linux-base (I am sure about that)
  • kmod
  • initramfs-tools
Related Topic