New kernel versions bring various improvements from security patches and bug fixes to improved performance and stability. 

Generally speaking, keeping up with the Ubuntu LTS release kernels is enough to ensure you’re getting such benefits. But sometimes it’s necessary to install more recent kernel versions for specific reasons like fixing hardware incompatibility. 

With this in mind, we’ll explain how you can update the Ubuntu kernel to the latest Ubuntu release, as well as mainline builds in this article.

Updating Ubuntu Kernel (GUI)

Most users should stick to the latest LTS release generic kernel. You can update to this build easily by using the Software Updater tool.

  1. Launch the Software Updater from the applications menu.
  2. If a new Ubuntu release kernel is available, it’ll be listed in the Details section.  Press Install now to install it and any other updates you want.
  3. Hold Shift and restart when prompted to complete the installation.
  4. Select Advanced options for Ubuntu and select the new kernel when booting.

Installing Mainline Kernel Build

The Mainline Kernel builds are basically unaltered upstream kernels that are configured and packaged as .deb files for Ubuntu. These are intended for debugging purposes and don’t receive any security patches. As such, mainline builds are not recommended for production use. Having said that, installing a mainline build is fairly straightforward. 

You can start by checking your current kernel version.

cat /proc/version_signature

The first series of digits indicates the kernel version, followed by the kernel flavor (default – generic), and finally the mainline kernel-version. 

Download the files for the Kernel version you want. We’ll install v6.0 for this tutorial, so we’ll download the header, image, and module files:

wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-headers-6.0.0-060000-generic_6.0.0-060000.202210022231_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-headers-6.0.0-060000_6.0.0-060000.202210022231_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-image-unsigned-6.0.0-060000-generic_6.0.0-060000.202210022231_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0/amd64/linux-modules-6.0.0-060000-generic_6.0.0-060000.202210022231_amd64.deb

cd to the directory where the files were downloaded. If the directory only contains the packages downloaded earlier, run

sudo dpkg -i *.deb

If there are other .deb packages too, install each package individually instead with

 sudo dpkg -i <filename>.deb

After installing the kernel, hold Shift and restart your machine. Select Advanced Options for Ubuntu and boot with the new kernel as done in the previous section.

Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.