Do you want to try out the latest Linux kernel version on Ubuntu 20.04 LTs Focal Fossa? Then here are the simplest ways to do that using a script.
The Linux kernel is the base of any available Linux operating system that allows applications to communicate with the hardware. It is really necessary to manage different resources such as CPU, Memory, and more… The latest version of the Linux while writing this article was Linux kernel 5.8.1, codenamed “Kleptomaner Krake”
It is published by chief developer Torvalds and the largest version to date with the greatest number of individual changes to the project. Those involved have added around 16,300 new contributions to the Linux kernel without merging code branches.
Among many other changes in the new Linux Kernel 5.8 version support for Intel’s Tigerlake platform is enabled. The AMDGPU driver now supports peer-to-peer-based PCI buffer sharing and the encryption of GPU memory. In addition, the DRM connectors now use Sysfs to inform the user-space about hotplug events that occur when certain devices are newly connected.
Here we will learn the process to upgrade Linux kernel directly from PPA using ubuntu-mainline-kernel.sh (script) rather download each Debian file of the latest kernel on Ubuntu. However, those who don’t want to use the script then install each file manually: Upgrade Linux kernel on Ubuntu by manually installing Debian packages.
What we learn here:
- Upgrade ubuntu 20.04 kernel to the latest
- install Linux kernel via upgrade script
- Uninstall previous or current installed kernel
What we need:
- Script- ubuntu-mainline-kernel.sh
- Internet connection
- Ubuntu 20.04 LTS server or Desktop system
Install or uninstall the latest Linux kernels from the Ubuntu Kernel PPA
Open command Terminal
If you are using a server OS of Ubuntu 20.04 with CLI then you are already on the terminal, however, the GUI users can open it from the Applications or using the keyboard
Although, the running system update command is not necessary, however, to make sure all the installed packages are up to date run it:
sudo apt update
Download ubuntu-mainline-kernel script
The next thing is downloading the
ubuntu-mainline-kernel.sh a utility that fetches and allow us to install the latest possible Linux kernel on any available Ubuntu operating system such as Ubuntu 20.04/19.04/18.04/17.04/16.04…
Install Script in Executable path
To install and run regardless of the directory in which you are, we will set up it in the executable directory path of the Linux that is
Thus, run the following command, this will run ubuntu-mainline-kernel.sh and install the Linux kernel upgrade tool in the
sudo install ubuntu-mainline-kernel.sh /usr/local/bin/
Check and install the latest Linux kernel
So, finally, everything is ready, now let’s run the command to check which is the latest version available for the installation for Ubuntu 20.04 LTS.
The Kernel upgrade command will be:
The above command will search and let you know the best possible latest version of the Linux kernel.
And after that, if you want to install the same, run:
sudo ubuntu-mainline-kernel.sh -i
The output for the above command in our case:
[email protected]:~$ ubuntu-mainline-kernel.sh -c Finding latest version available on kernel.ubuntu.com: v5.8.1 Finding latest installed version: none A newer kernel version (v5.8.1) is available [email protected]:~$ sudo ubuntu-mainline-kernel.sh -i Finding latest version available on kernel.ubuntu.com Latest version is: v5.8.1, continue? (y/N) Will download 6 files from kernel.ubuntu.com: Downloading amd64/linux-headers-5.8.1-050801-generic_5.8.1-050801.202008111432_amd64.deb: 100% Downloading amd64/linux-headers-5.8.1-050801_5.8.1-050801.202008111432_all.deb: 100% Downloading amd64/linux-image-unsigned-5.8.1-050801-generic_5.8.1-050801.202008111432_amd64.deb: 100% Downloading amd64/linux-modules-5.8.1-050801-generic_5.8.1-050801.202008111432_amd64.deb: 100% Downloading amd64/CHECKSUMS: 100% Downloading amd64/CHECKSUMS.gpg: 100% Importing kernel-ppa gpg key ok Signature of checksum file has been successfully verified Checksums of deb files have been successfully verified with sha256sum Installing 4 packages Cleaning up work folder [email protected]:~$
Restart System and check version
Finally, reboot the system. Once you get the command terminal type the below command to check the current Linux kernel version of your system.
Downgrade or uninstall latest Linux Kernel (optional)
In case you want, your previous kernel back on your Ubuntu system, then we can use the same script that we ran to install it. Here is the command:
sudo ubuntu-mainline-kernel.sh -u