The Linux kernel is the brain of your operating system. Without it, your computer would be nothing more than an expensive paperweight. However, like all of us, your kernel can start to get old. Due to the open source nature of Linux, the kernel is constantly updated to remove vulnerabilities and improve performance.
That’s why it’s a good idea to keep your kernel up to date, as using an outdated Linux kernel could put you and your data at risk. There are several ways to update the Linux kernel. The good news is that if you screw up, you can always reboot your system with the previous version and fix whatever went wrong.
If you’re ready to say goodbye to your outdated kernel, then here’s how to complete a kernel upgrade on Linux.
What is the Linux kernel and why should you upgrade it?
The word kernel means the central part or kernel, and that is exactly what your Linux kernel is. It is the core of your operating system and is the link between your computer’s hardware and the applications that run on the system. The kernel takes care of key tasks like memory management and process access to the CPU. In other words, it is quite important when it comes to making your computer perform as expected of it.
The strength of Linux as an operating system is that it is open source, which means that anyone can make improvements to the software design. However, this strength can also be a weakness. With software changes, there is a risk that vulnerabilities could be created that make the operating system less secure. When these vulnerabilities are discovered, patches are applied to remove them, and these patches are included in kernel updates.
Keeping the kernel up to date ensures that the system is as secure as possible.
A kernel update is different from a kernel upgrade. Updates are big advances in the operating system, often with significant changes or new features. By contrast, a kernel update is a minor change meant to fix minor issues in the current version. Updates are much more frequent than major kernel updates and do not 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 does the automatic updates for you.
How to Perform a Linux Kernel Update Using the Terminal
If you want to perform a manual kernel update, you can use the Linux terminal command line to do so.
You will need to download the kernel you want to install – it is always recommended to use the latest stable kernel to avoid any unexpected problems.
To perform a Linux kernel update in the Linux terminal:
- open a window Terminal on your Linux PC.
- To find out the current version of your operating system, type:
The -s option returns the kernel name, and the -r option returns the kernel version.
- Take note of the version that is returned. The first value is the kernel version, and the second is the major version. So, for example, 4.4 would be followed by 4.5. The next value is the minor revision version, with the fourth value being the current version of bug fixes and other patches.
- The next step is to find the new kernel version to upgrade to. In this example, we are using Ubuntu. Major kernel versions can be found at ubuntu.com.
- Find the kernel you want to use. Avoid any options ending in ‘rc’, as these are release candidates. In this case, the latest stable version is v6.1.9.
- Look for the files corresponding to the type of computer you use and download them. Save them in a folder that does not contain other .deb files.
- Once the kernel files are downloaded, open the window again Terminal.
- Use the change directory command to navigate to the location where you downloaded the kernel files.
- Enter the following command to install the downloaded .deb files:
sudo dpkg -i *.deb
- After the installation is complete, restart your computer.
- Open a Terminal window and check the current kernel again using:
- You should see the updated kernel you installed.
How to update the Linux kernel (Kernel) with a GUI tool
If you’re not a fan of Terminal, it’s possible to use a GUI tool to perform the Linux kernel upgrade. One of the most popular free tools for this purpose was Ukuu, but now it has become a paid application.
However, there is a free fork of Ukuu called Mainline, which we will use in this example.
To perform a Linux kernel upgrade using Mainline:
- open Terminal and enter the following commands:
sudo apt-add-repository -y ppa:cappelikan/ppa sudo apt update sudo apt install mainline
- After the installation is complete, run the application Ubuntu Mainline Kernel Installer.
- At the bottom of the main screen you will see the current kernel version and the most up-to-date version available.
- Select an updated version of your kernel and click Install.
- After the installation is complete, you will see that the new kernel is installed, but the original kernel is still working.
- To run the new kernel, reboot the computer.
- When the computer has restarted, open Terminal and enter the following command to confirm that you are running the updated kernel:
How to update the Linux kernel with Software Updater
Another way to update the kernel is to update the entire operating system to the latest version. The latest version is likely to include an updated version of the Linux kernel. You can usually update to the latest version through an update manager application included with your operating system.
In this example, we are using Software Updater on Ubuntu. Check if this software (or a similar one) is available for your Linux distribution.
To update your operating system to the latest version using Software Updater:
- open the app Software Updater on the menu Applications.
- The app will check for updates. If an updated version is available, you’ll see a message telling you the latest version available.
- Click on Update.
- Follow the instructions on the screen to update to the new version.
- When the update is complete, a message will appear asking you to restart your computer. You will need to do this for the update to take effect.
- After your computer has rebooted, you can confirm which kernel is currently running by entering the following command in Terminal:
- At this point, you should see that a more up-to-date version of the kernel is now running on your PC.
Keep Linux running smoothly
Learning how to complete a kernel update on Linux allows you to ensure that you are running an up-to-date version to keep your system as secure as possible. However, there are other things you can do to keep Linux running as smoothly as possible.