1. Overview

The kernel plays an important role in determining the performance of a Linux machine. If we have the latest kernel update on the system, it indicates that the device is likely to perform better due to the improvements and features that newer versions bring. Besides that, updates also ensure the stability, integrity, and security of the system. Thus, Linux maintainers are continuously improving the kernel by releasing new versions and patches for different devices. If we regularly update it using these releases, we should be able to smoothly operate on our Linux machines.

In this tutorial, we’ll discover some methods that we can use to update the Linux kernel to the latest version.

Notably, each of the methods we discuss requires that we have the latest repositories configured in our system, which should be running a standard kernel.

Before moving forward, let’s note that we’ll perform the update operation on Ubuntu. However, the same process applies to other Debian-based distributions as well.

2. Update Using apt

The apt command is the main package manager for Debian-based Linux distributions such as Ubuntu. We can use it to install, upgrade, and remove packages from the system. In addition to managing userspace packages, APT can also update the kernel to the latest version.

Before doing that, let’s check the kernel version that we’re currently operating on:

$ uname -r
6.4.16-33-generic

The uname command with the -r option prints the currently running kernel release to the terminal, which we can see above.

Now, the first step is to use the apt update command to update the package list on the system:

$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.

Evidently, there are three upgradable packages on the system.

So, the next step is to use the apt upgrade command to upgrade these packages to their latest versions. At this point, if the kernel is also upgradable, apt includes it in the operation:

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  accountsservice alsa-ucm-conf apparmor
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
0 standard security updates
Need to get 56 MB of archives.
After this operation, 314 kB of additional disk space will be used.
Do you want to continue? [Y/n] yes

Above, the terminal asked for our permission to continue with the upgrade, which we’ve permitted by typing yes in the terminal.

Once we hit Return, the upgrade process should commence. During this process, the kernel should be updated to the latest version along with the other upgradable packages on the system.

Upon completion, we again use the uname -r command to check the kernel release that’s currently active on the system:

$ uname -r
6.4.16-37-generic

Visibly, the kernel release that we’re currently using is now a bit newer.

3. Update Using Software Updater

Before proceeding with this method, it’s usually best to back up all of the important files on the system to ensure that they’re safe in case of a failure.

Now, the first step is to open Software Updater on the system:

Software Updater

Once it’s opened, it automatically checks for new updates:

Software Updater - Checking for Updates

If there are new updates for the system, we install them first. In this case, there are no new updates.

Next, let’s click on the Settings & Livepatch button to proceed:

Software-Updater - Settings & Livepatch

A new window shows up on the screen. Here, let’s navigate to the Updates tab:

Software Updater - Updates Tab

Then, let’s click on the dropdown labeled Subscribed to and select the All updates option:

Software Updater - Subscription

After that, we click on the dropdown labeled Notify me of a new Ubuntu version and select the For long-term support versions option:

Software Updater - Notification

Once the last step is done, we close the window and reopen the application. If there’s an update available, the application should automatically offer to install it. In this case, we perform the installation to upgrade the system as well as the kernel to their latest versions.

4. Release Upgrade With do-release-upgrade

In case the Software Updater application doesn’t offer us updates, we can attempt a full-release upgrade.

In particular, we use the do-release-upgrade command to upgrade the system and the kernel to their latest versions:

$ sudo do-release-upgrade
Checking for a new Ubuntu release

= Welcome to Ubuntu 22.04 'Jammy Jellyfish' =
The Ubuntu team is proud to announce Ubuntu 22.04 'Jammy Jellyfish'.

To see what's new in this release, visit:
  https://wiki.ubuntu.com/JammyJellyfish/ReleaseNotes

Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.

== More Information ==

You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:

  http://www.ubuntu.com/

To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:

  http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce

Continue [yN] yes

As we can see above, we have a new update available for the system. To install this update, we type yes in the terminal when prompted. Once we hit Return, the upgrade process takes off and upon completion, the system and the kernel are updated to their newest versions.

5. Conclusion

In this article, we explored three different methods that we can follow to update the kernel to the latest version. No matter which one we choose, we should be able to update the kernel to the newest version with ease.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments