In this tutorial, we are going to learn how to upgrade Linux Kernel to 5.16 on Ubuntu 20.04.
Linux Kernel is a free and open-source, monolithic, modular, multitasking Unix-like operating system. It is the main component of a Linux operating system and is the core interface between the computer’s hardware and its processes. It makes communication possible between computer hardware and processes running on it and it manages resources effectively.
Linux 5.16 mainline was released recently by Linux Torvalds with better new features to try out. The mainline tree is maintained by Linus Torvalds and It is where all new features are added and releases always come from.
Notable updates on this release are:
- Intel Advanced Matrix Extension support is now stable with this release.
- This kernel now supports Rasperry-Pi compute modules
- Raptor Lake p[rocessor support is included in this release.
- It now bring support for Rockchips
- It has added Apple magic keyboard
- How to upgrade Ubuntu 20.04 Linux Kernel from 5.4 to 5.15
- How to upgrade Linux Kernel on Rocky Linux/AlmaLinux/CentOS 8
- How to upgrade Linux Kernel 5.13 to 5.15 on Ubuntu 21.10
Table of Contents
- Run updates for your system
- Check the current version of Linux kernel you are running
- Download Linux kernel headers from Ubuntu Mainline
- Download Linux Kernel image
- Download modules required to build the kernel
- Install new kernel
- Reboot the system
Upgrade Linux Kernel to 5.16 release
1. Run system update
The first thing to do is to run system updates on our Ubuntu 20.04 server. Use the following command on your terminal.
$ sudo apt update && apt upgrade -y
When upgrades and updates are complete, we can now begin to download headers, modules, and images.
2. Download Linux kernel Headers.
Linux kernel headers is a package providing the Linux kernel headers. These are part of the Kernel even though shipped separately. The headers act as an interface between internal kernel components and also between userspace and the kernel.
To download this package header, head over to the Ubuntu PPA mainline repository and make downloads for your amd64 system. We are going to download the following header files.
$ wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16-rc5/amd64/linux-headers-5.16.0-051600rc5_5.16.0-051600rc5.202112121931_all.deb
You will see the following output from your terminal.
output --2021-12-14 08:44:29-- https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16-rc5/amd64/linux-headers-5.16.0-051600rc5_5.16.0-051600rc5.202112121931_all.deb Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 126.96.36.199 Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|188.8.131.52|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 12284980 (12M) [application/x-debian-package] Saving to: ‘linux-headers-5.16.0-051600rc5_5.16.0-051600rc5.202112121931_all.deb’ linux-headers-5.16.0-051600r 100%[===========================================>] 11.72M 60.9MB/s in 0.2s 2021-12-14 08:44:30 (60.9 MB/s) - ‘linux-headers-5.16.0-051600rc5_5.16.0-051600rc5.202112121931_all.deb’ saved [12284980/12284980]
Another header file to download is this one.
$ wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16-rc5/amd64/linux-headers-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb
Sample output will look like this:
output --2021-12-14 08:45:17-- https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16-rc5/amd64/linux-headers-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 184.108.40.206 Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|220.127.116.11|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2908436 (2.8M) [application/x-debian-package] Saving to: ‘linux-headers-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb’ linux-headers-5.16.0-051600r 100%[===========================================>] 2.77M --.-KB/s in 0.1s 2021-12-14 08:45:17 (27.9 MB/s) - ‘linux-headers-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb’ saved [2908436/2908436]
Note the difference between those headers
2. Download Linux kernel Modules
Linux kernel are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. A module can be configured as built-in or loadable. To dynamically load or remove a module, it has to be configured as a loadable module in the kernel configuration.
To download the Linux Kernel module run the following command on your terminal.
$ wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16-rc5/amd64/linux-modules-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb
Next is to download the image.
3. Download Linux Kernel Image
Linux kernel image is a snapshot of the Linux kernel that is able to run by itself after giving the control to it. For example, whenever you need to boot the system up, it will bootload an image from the hard disk.
To download the Linux Kernel image 5.16 run the following command on your terminal.
$ wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16-rc5/amd64/linux-image-unsigned-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb
Make sure you are seeing the image from the downloads.
Sample output will look like this:
Output linux-image-unsigned-5.16.0- 100%[===========================================>] 9.85M 55.5MB/s in 0.2s 2021-12-14 08:47:29 (55.5 MB/s) - ‘linux-image-unsigned-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb’ saved [10329384/10329384]
Now that we have finished downloading images, modules, and headers it is now time to install them but first, let’s confirm our downloads.
$ ls linux-headers-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb linux-headers-5.16.0-051600rc5_5.16.0-051600rc5.202112121931_all.deb linux-image-unsigned-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb linux-modules-5.16.0-051600rc5-generic_5.16.0-051600rc5.202112121931_amd64.deb
4. Install Linux Kernel on Ubuntu 20.04
To install Linux Kernel 5.16, let’s run the following command;
$ sudo dpkg -i *.deb
Wait for the process to complete before restarting the system.
After you have restarted the system, check the Linux Kernel release installed.
$ uname -r
the output you will now get is like this;
As you can see we have successfully upgraded from 5.4.0-88-generic to 5.16.0-051600rc5-generic, the latter being the latest release.