Install a newer kernel in Debian 9 (stretch) stable

When using the latest version of Debian 9 stable, even with all updates installed, by default, you can’t get a very recent kernel via the standard repositories in your package manager. While the idea of using Debian stable is to remain stable and rather conservative, there are several benefits with installing a newer kernel and in some cases it’s the only option to get the OS to support all your hardware. The risk and impact on stability is small and the process is rather simple.

Some of the benefits are:

  • Support for previously unsupported hardware: every kernel release has a list of added drivers. Especially when you have recent hardware, a newer kernel could be required to fully support your video card for example.
  • Performance improvements and bug fixes: newer kernels often contain a lot of bug fixes, have new functions and performance tweaks. Here again, the most is to gain on newer hardware.
  • New kernel options and security fixes

The most recent (stable) kernel that is available at the moment of writing is version 4.12, released 27/07/2017. You can find a complete overview of changes in every kernel version at or

The latest version of the kernel available, at the time of writing, via the standard repositories for Debian 9 is/was. As you can see this kernel is quite recent but Stretch has just been released:

There are basically two options to install a newer kernel in Debian stretch. The first is the easiest and this is what I will explain in this post. The second is not so easy. It is simply to compile a newer kernel yourself. While compiling a kernel nowadays isn’t rocket science anymore, the first way is still preferable and will save you a lot of time because others have been through the second method and present you the result of their work :)

Installing a newer kernel in Debian Stretch

The easiest way to install a newer kernel in Debian, is to install it from the backports. Backports are packages taken from the next Debian release (called “testing”), adjusted and recompiled for usage on the stable release. For this post, I’m starting with a minimal install (system tools only), the only packages I added after finishing the installation were sudo and aptitude.

In order to install a kernel from the backports, we need to add the backports-repository for our Debian version to the apt-sources and update the list of available packages:

Now, you can browse the available kernels in the backports-rpository by adding -t wheezy-backports to your apt commands.:

Before installing a newer kernel, it’s important that we upgrade installed packages to their newer versions in the backports-repo in order to be sure that dependencies will remain unbroken.

After the upgrade, choose a kernel from the list and install it with apt. Most of the installations would want the kernel without suffix. The rt-suffix stands for realtime and is mostly interesting for embedded projects or machines that will drive industrial hardware. dbg stands for debugging.

After the installation, reboot your system and select the newly installed kernel from the selection displayed in GRUB. Debian selects the new kernel by default.’

To verify that the new kernel is used after booting:

Uninstalling unused kernels in Debian

When everything works as expected, you can safely uninstall the older kernel in order to clean up your system and to free up some space in /boot

To check which kernels are currently installed:

Uninstall the old one:

That should be all it takes in order to install a recent kernel and cleanup older kernels on a Debian system. Not so difficult as you thought probably :)

14 thoughts on “Install a newer kernel in Debian 9 (stretch) stable

  1. Thanks for this guide. Nicely written and easy to understand. Haven’t tried it yet, however. I do have one question. What does installing all of these “backports” do to the upgrade process when Debian V10 comes out. I have read lots of “info” online, none of which makes much sense to me. Some say do nothing. Some say they all have to be uninstalled prior to a release upgrade. …
    Can you give us some guidance here?

      Backports are packages taken from the next Debian release (called “testing”), adjusted and recompiled for usage on Debian stable. Because the package is also present in the next Debian release, you can easily upgrade your stable+backports system once the next Debian release comes out. (In a few cases, usually for security updates, backports are also created from the Debian unstable distribution.)

  2. this tips do work for kali-linux as well :=)

    i did just test the Uninstalling unused kernels part inside 2017.2 x64

  3. Hi,
    My problem is the other way around. When I upgraded I got boot issues (can’t boot basically with the new kernel). Could I uninstall the newer kernel and default to the previous one via the process you described here or is there a way to find the issue and fix it?

  4. Great and very easy to follow. I wish Debian could advice their user in a similar way. Not everyone using Debian want to compile kernels.

  5. nice writeup. installed 4.14 with no problem.
    question: what does this do to the apt-get update/upgrade process going forward. do we always have to specify the stretch-backports in the upgrade command? if yes, what bad happens if we forget?

  6. Thank you for the excellent article written with new Debian users in mind, such as myself (a student). Linux is excellent and the Linux community such “” is awesome!!!

  7. re:

    “..Now, you can browse the available kernels in the backports-rpository by adding -t wheezy-backports to your apt commands.:…”

    i take it you meant “…stretch-backports…”

  8. Thank you for nice tutorial. I installed the
    Linux nb-vortex 4.16.0-0.bpo.2-amd64 #1 SMP Debian 4.16.16-2~bpo9+1 (2018-06-26) x86_64 GNU/Linux.

  9. …but how to select the newly installed kernel from the selection displayed in GRUB when you work on vps ? When i do reboot on vps and connection is closed, i cannot select grub.

Leave a Reply to proj964 Cancel reply

Your email address will not be published. Required fields are marked *