How-To

How to Complete a Kernel Update on Linux

PC update featured

It’s important to keep Linux kernel up-to-date to protect yourself against known vulnerabilities. To update the Linux kernel, follow this guide.

The Linux kernel is the core brain of your operating system. Without the kernel, your computer would just be an expensive paperweight. Like all of us, however, your kernel can begin to get old. Thanks to the open-source nature of Linux, the kernel is constantly being updated to remove vulnerabilities and improve performance.

That’s why it’s a good idea to keep your kernel updated as using an outdated Linux kernel could put you and your data at risk. There are a number of different ways you can go about updating the Linux kernel. The good news is that, if you mess things up, you can always boot up your system using the previous version and fix anything that went wrong.

If you’re ready to say goodbye to your outdated kernel, then here’s how to complete a kernel update in Linux.

What is the Linux Kernel and Why Should You Update It?
linux kernel

The word kernel means the central part or core, and that’s exactly what your Linux kernel is. It’s the core of your operating system and is the link between your computer’s hardware and the applications that run on the system. Your kernel is in charge of key tasks such as managing memory and granting processes access to your CPU. In other words, it’s a pretty big deal when it comes to your computer working as expected.

The strength of Linux as an operating system is that it’s open source, meaning that anyone can make improvements to the design of the software. This strength can also be a weakness, however. With changes to the software, there is a risk of vulnerabilities being created that make the OS less secure. When these vulnerabilities are discovered, patches are applied to remove them, and these patches are included in kernel updates.

Keeping your kernel updated ensures that you’re keeping your system as secure as possible.

A kernel update is different from a kernel upgrade. Upgrades are major moves forward in the OS, often with significant changes or new features. In contrast, a kernel update is a smaller change intended to fix minor issues with the current version. Updates are far more frequent than major kernel upgrades and don’t occur at regular intervals.

That’s why it’s a good idea to regularly check for kernel updates. Alternatively, you can set up a package that can perform automatic updates for you.

How to Perform a Linux Kernel Update Using Terminal

If you want to perform a manual kernel update, you can use the command line in the Linux terminal to do so.

You’ll need to download the kernel that you want to install—it’s always advisable to use the latest stable kernel to avoid any unexpected problems.

To perform a Linux kernel update in the Linux terminal:

  1. Open a Terminal window on your Linux PC.
  2. To find out the current version of your operating system, type:
    uname -sr

    The -s option returns the kernel name, and the -r option returns the kernel release.

  3. Make a note of the version that is returned. The first value is the kernel version, with the second being the major release version. So 4.4 would be followed by 4.5, for example. The next value is the minor revision version, with the fourth value being the current version of bug fixes and other patches.
    linux current kernel
  4. The next step is to look for the new kernel version to update to. In this example, we’re using Ubuntu. The mainline kernel versions can be found at ubuntu.com.
  5. Find the kernel that you want to use. Avoid any options ending in ‘rc’ as these are release candidates. In this case, the latest stable release is v6.1.9.
    linux latest stable mainline version
  6. Find the files for the type of computer you’re using and download them. You’ll want to save them in a folder that doesn’t contain any other .deb files.
    linux kernal packages
  7. Once the kernel files have been downloaded, open the Terminal window again.
  8. Use the change directory command to navigate to the location where you download the kernel files.
    cd Downloads
  9. Enter the following command to install the downloaded .deb files:
    sudo dpkg -i *.deb
  10. Once the installation is complete, reboot your computer.
  11. Open a Terminal window and check the current kernel again using:
    uname -rs
  12. You should see the updated kernel that you installed.

How to Perform a Linux Kernel Update Using a GUI Tool

If you’re not a fan of Terminal, it’s possible to use a GUI tool to perform the Linux kernel update. One of the most popular free tools for this purpose was Ukuu, but this has now moved to a paid application.

There is, however, a free fork of Ukuu called Mainline, which we will be using in this example.

To perform a Linux kernel update using Mainline:

  1. Open Terminal and enter the following commands:
    sudo apt-add-repository -y ppa:cappelikan/ppa
    
    sudo apt update
    
    sudo apt install mainline
  2. Once the installation is complete, launch the Ubuntu Mainline Kernel Installer app.
    linux mainline app
  3. You’ll see the currently running kernel version and the most up-t0-date available version at the bottom of the main screen.
    linux current kernel in mainline
  4. Select an updated version of your kernel and click Install.
    linux install updated kernel in mainline
  5. Once the installation is complete, you’ll see the new kernel is installed, but the original kernel is still running.
    linux installed kernel in mainline
  6. To run the new kernel, restart your computer.
  7. When the computer has restarted, open Terminal and enter the following command to confirm you are running the updated kernel:
    uname -rs

How to Perform a Linux Kernel Update Using Software Updater

Another way to update your kernel is to update your entire OS to the latest release. The latest release is likely to include an updated version of the Linux kernel. You can usually update to the latest release through an update manager application included with your OS.

In this example, we’re using Software Updater in Ubuntu. Check if this software (or similar) is available for your Linux distribution.

To update your OS to the latest release using Software Updater:

  1. Open the Software Updater app in your Applications menu.
    linux software updater
  2. The app will check for any updates. If there is an updated release available, you’ll see a prompt telling you the latest version that is available.
  3. Click Upgrade.
    linux upgrade software
  4. Follow the on-screen instructions to upgrade to the new release.
  5. When the update is finished, you’ll see a prompt to restart your computer. You’ll need to do this before the upgrade will take effect.
  6. When your computer has restarted, you can confirm the kernel that’s currently running by entering the following command in Terminal:
    uname -r
  7. At this point, you should see that a more up-to-date version of the kernel is now running on your PC.
    linux updated kernel

Keep Linux Running Smoothly

Learning how to complete a kernel update in Linux allows you to ensure that you’re running an up-to-date version to keep your system as secure as possible. There are other things you can do to keep Linux running as smoothly as possible, however.

If you find yourself running out of disk space, you can check disk space in Linux to find out what’s using it all up. When you delete those offending files, they may still not be completely gone; that’s why it’s useful to learn how to securely delete files in Linux.

If you use a password for your Linux computer, and you haven’t changed yours for a while, then it could be a good idea to change your Linux password.

Click to comment

Leave a Reply

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

 

To Top