How to Downgrade the Kernel in Ubuntu
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:
- Restart or boot up your Ubuntu system.
- 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.
- If you’ve done it right, the GRUB menu will appear. Use the Down Arrow key to select Advanced Options for Ubuntu.
- Press Enter.
- 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.
- 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:
- Open a Terminal window.
- Enter the following command to list the installed Linux images on your computer:
dpkg –list|grep linux-image
- Press Enter.
- Make a note of the exact name of the kernel you want to remove.
- Enter the following command to list the Linux headers, as you’ll need to remove the kernel header too:
dpkg -list|grep linux-header
- Press Enter.
- Make a note of the Linux header you want to remove.
- 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
- Press Enter.
- Confirm that the correct package is listed as being removed, and click Y.
- The kernel will be removed.
- 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
- Press Enter.
- Your Linux header should be removed.
- You can check that you have been successful by listing the installed kernels again with the command:
dpkg –list|grep linux-image
- Press Enter.
- 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:
- Open a Terminal
- Enter the following commands to install mainline:
sudo apt-add-repository -y ppa:cappelikan/ppa sudo apt update sudo apt install mainline
- Once the app is installed, launch the Ukuu Mainline Kernel Installer app.
- You should see the currently running kernel listed.
- Select an earlier version of the Linux kernel and click Install.
- Wait for the installation process to complete.
- Restart your computer, and boot into this earlier version of the kernel by following the steps from the first section of this article.
- Once your computer has restarted, launch the Ukuu Mainline Kernel Installer again.
- You should now see that you’re running the downgraded kernel—select the installed kernel that you want to remove and click Uninstall.
- 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.
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.
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 –