How-To

How to Downgrade the Kernel in Ubuntu

ubuntu how to downgrade the kernel

Have you upgraded your Ubuntu kernel, only to find it’s causing problems? Learn how to downgrade the kernel in Ubuntu using this guide.

The kernel is one of the most important parts of your operating system. Without it, your hardware and software couldn’t communicate, and your computer would be just an expensive box.

If you’re using a Linux system like Ubuntu, then the kernel is constantly being updated and improved. That’s why it’s a good idea to try to keep the kernel as up-to-date as possible to reduce the risk of security flaws. However, you may find that upgrading to the latest Ubuntu kernel causes things to go wrong on your system.

If this happens, don’t panic—you can easily turn things around. Here’s how to downgrade the kernel in Ubuntu.

What is a Kernel?

The kernel is the core of your operating system. It’s the go-between that allows your software and applications to talk to your computer hardware. Your kernel is in charge of some vital processes, including managing your system memory and granting processes access to the CPU. All modern operating systems (including Windows, Linux, and macOS) use a kernel to allow your hardware and software to work together.

As with almost all computer software, your kernel is constantly being updated and improved. When flaws or security vulnerabilities are discovered, newer versions of the kernel are released to try to fix these issues. That’s why keeping your kernel upgraded regularly is a good way to keep your system running smoothly and securely.

Sometimes, however, the latest upgrade to your kernel may cause issues, when the previous version was running just fine. If this is the case, you’ll probably want to downgrade the kernel to keep your computer running smoothly.

How to Boot into an Older Kernel in Ubuntu

Ubuntu has a useful feature that can be a real lifesaver if you update your kernel and things start going wrong. By accessing the GRUB menu when you boot into Ubuntu, you can opt to boot using a previously installed kernel, rather than using the one you’ve just updated to.

This allows you to remove the updated kernel if it’s causing issues so that you can boot normally without having to select a different kernel.

To boot into an older kernel in Ubuntu:

  1. Restart or boot up your Ubuntu system.
  2. As soon as the start-up process begins, hold down Esc if your system boots using UEFI or Shift if you boot using BIOS. If you’re not sure, try both methods until you find which one works.
  3. If you’ve done it right, the GRUB menu will appear. Use the Down Arrow key to select Advanced Options for Ubuntu.
    ubuntu grub advanced options
  4. Press Enter.
  5. Select the kernel you want to use. The lower the version number, the older the kernel, so if a recently updated kernel is causing issues, choose a version that doesn’t have the highest version number.
    ubuntu select kernel in grub
  6. Press Enter and Ubuntu will boot using the selected kernel.

How to Remove a Kernel in Ubuntu

Once you’ve booted using an older kernel, you can delete the updated kernel that was causing the issues. Doing so means that the next time you boot, Ubuntu will use an earlier kernel instead. This should remove any issues that the upgraded kernel was causing. In order to remove a specific kernel, you’ll need to find its exact name first.

To remove a kernel in Ubuntu:

  1. Open a Terminal window.
  2. Enter the following command to list the installed Linux images on your computer:
    dpkg –list|grep linux-image
  3. Press Enter.
  4. Make a note of the exact name of the kernel you want to remove.
    ubuntu kernel image name
  5. Enter the following command to list the Linux headers, as you’ll need to remove the kernel header too:
    dpkg -list|grep linux-header
  6. Press Enter.
  7. Make a note of the Linux header you want to remove.
    ubuntu kernel header name
  8. Enter the following command to remove the Linux image, replacing linux-image-unsigned-6.1.1-0601010-generic with the Linux image name you copied down in step 4:
    sudo apt-get purge linux-image-unsigned-6.1.1-0601010-generic
  1. Press Enter.
  2. Confirm that the correct package is listed as being removed, and click Y.
    ubuntu removed kernel
  3. The kernel will be removed.
  4. To remove the Linux kernel header, enter the following command, replacing linux-headers-6.1.1-060101-generic with the name you copied down in step 6:
    sudo apt-get purge linux-headers-6.1.1-060101-generic
  5. Press Enter.
  6. Your Linux header should be removed.
  7. You can check that you have been successful by listing the installed kernels again with the command:
    dpkg –list|grep linux-image
  8. Press Enter.
  9. The kernel you deleted should no longer be listed.

How to Downgrade the Kernel in Ubuntu using a GUI Tool

If you prefer, you can use a GUI tool to install, upgrade, and downgrade your Linux kernel. The Ukuu tool has historically been a good choice, but this is now a paid app, so we won’t recommend it.

Instead, there’s a fork of Ukuu called Mainline that does the same thing for free, so that’s what we’ll be using in this example.

To downgrade the kernel in Ubuntu using Mainline:

  1. Open a Terminal
  2. Enter the following commands to install mainline:
    sudo apt-add-repository -y ppa:cappelikan/ppa
    
    sudo apt update
    
    sudo apt install mainline
  1. Once the app is installed, launch the Ukuu Mainline Kernel Installer app.
  2. You should see the currently running kernel listed.
    ubuntu mainline app
  3. Select an earlier version of the Linux kernel and click Install.
    ubuntu install kernel in mainline
  4. Wait for the installation process to complete.
  5. Restart your computer, and boot into this earlier version of the kernel by following the steps from the first section of this article.
  6. Once your computer has restarted, launch the Ukuu Mainline Kernel Installer again.
  7. You should now see that you’re running the downgraded kernel—select the installed kernel that you want to remove and click Uninstall.
    ubuntu uninstall kernel in mainline
  8. The selected kernel will be removed. When you restart, your computer will boot using the downgraded kernel.

Improve Your Ubuntu System

Knowing how to downgrade the kernel in Ubuntu can be a useful way to take a step back if your latest upgrade is causing issues. Remember that it’s always better to use a more recent kernel version, as older versions may have known flaws that were patched in later releases. But if the most recent kernel isn’t working for you, downgrading may be able to fix your problems.

As an Ubuntu user, there are plenty of other useful things you should know. You can learn how to install Microsoft Teams on Ubuntu if you need it for work. You can learn how to change the wallpaper background on Ubuntu to personalize your desktop. And you can even install Ubuntu as a dual-boot with Windows if you want to take advantage of both operating systems.

4 Comments

4 Comments

  1. John

    June 24, 2023 at 4:41 am

    the command “dpkg –list|grep linux-image” does not work:

    -:~$ dpkg –list|grep linux-image
    dpkg: error: need an action option

    Type dpkg –help for help about installing and deinstalling packages [*];
    Use ‘apt’ or ‘aptitude’ for user-friendly package management;
    Type dpkg -Dhelp for a list of dpkg debug flag values;
    Type dpkg –force-help for a list of forcing options;
    Type dpkg-deb –help for help about manipulating *.deb files;

    • lares

      July 30, 2023 at 6:28 am

      “dpkg –list | grep linux-image” will do.

    • anon

      August 11, 2023 at 10:18 pm

      You need two dashes before list. Look at the screencap.

  2. Tatiane Pires

    August 8, 2023 at 5:56 am

    I’ve just ran into an issue where my computer was not restarting or powering off while running kernel 6.2.0-26-generic, I knew I was running kernel 5.19.0-50-generic before this issue. I searched for downgrade kernel, and found your post. Thank you!

    About the dpkp –list commands, probably the post editing tool is turning — into –

Leave a Reply

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

 

To Top