This tutorial will help you upgrade the Linux kernel on Ubuntu. The benefit of upgrading kernel is, among many others, to get faster and better hardware performance. In this article, we picked up Kubuntu 22.04 “Jammy Jellyfish” as example to upgrade the kernel version from its default 5.15 into 6.5. It should be simple and easy to do. Now let’s do it.Â
(Kubuntu 22.04 with the latest Linux kernel version )
Â
Subscribe to UbuntuBuzz Telegram Channel to get article updates.
1. Check Kernel Versions
$ uname -a
$ apt-cache search linux-image-generic
$ apt-cache policy linux-image-generic
$ dpkg -l | grep -i linux-image-generic
$ lsb_release -a
Meanings:
First command will show installed kernel version. For example, on Kubuntu 22.04, before upgrade it shows 5.15. After upgrade, it will show 6.5.
Second command will search for packages related to the Linux kernel available on Ubuntu. To upgrade our kernel, we will install the package named linux-image-header-hwe-22.04.
Third command will show a listing of available versions of the Linux kernel package linux-image-generic-hwe-22.04, in newer higher order, with triple stars (***) –if any– pointing to the installed one.
Â
Third command will show a listing of installed packages in the system related to, and including, linux-image-generic, the kernel package with versions and more information.
Fourth command will show information regarding distro version and codename. This is important to determine which kernel versions available to use. For example, for our system it shows “ubuntu” and “22.04 LTS” and “jammy”. This is why we select linux-image-generic-hwe-22.04 package for upgrading our kernel.
2. Install New Kernel Version
Â
$ sudo apt-get install linux-image-generic-hwe-22.04
Meaning:
This command will download and update new Linux kernel by installing linux-image-generic-hwe-22.04. Note that this does not remove the old kernels at all.
3. Reboot
$ sudo reboot
Meaning:
This command will restart your computer. After this step, repeat step 1 and you should find your Ubuntu now runs with the new kernel i.e. the 6.5 version. If this works, then it is successfully installed and you do not need to do optional steps number 4-5 below. Congratulations!
****
4. Update Bootloader (Optional)
Â
Only if you encountered any errors, do the following:
$ lsblk
$ sudo grub-install /dev/sdb3 # see notes (*)
$ sudo update-grub
Meanings:
First command will show a listing of existing hard disk partitions as well as any other storage (cdrom, sdcard, external drives) currently attached. In this output, you should find your EFI partition. For example, ours is /dev/sdb3.
Second command will install the bootloader GNU GRUB if you do not have it installed yet. On most cases, this is not required. However, in this example, ours is /dev/sdb3.
Third command will actually update your bootloader to recognize and use by default the new kernel you installed.
(*) Notes: only do this command if the bootloader itself has not been installed.
5. Revert Back to Older Kernel Temporarily (Optional)
Under the GNU GRUB Bootloader when booting, under Ubuntu, select Advanced Options.Â
A listing of kernel versions will show.Â
With keyboard arrow keys up and down, select an older kernel version, for example 5.15, then press Enter.
System will boot and run with older kernel.
Â
 ****
Â
See Also
Relationship between Linux and GNU by The GNU Project
References
Kernel Upgrade by Ubuntu Community Wiki