Install latest Linux Kernel on Ubuntu 20.04 Focal Fossa via PPA

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:

  • A sudo user
  • 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 CTL+ALT+T

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…

wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh 

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 /usr/local/bin/

Thus, run the following command, this will run ubuntu-mainline-kernel.sh and install the Linux kernel upgrade tool in the /bin.

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:

ubuntu-mainline-kernel.sh -c 

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:

h2s@ubuntu2004:~$ 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
ubuntu@ubunu2004:~$ 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
h2s@ubuntu2020:~$

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.

uname -rs
Check current installed Linux kernel min

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

 

1 thought on “Install latest Linux Kernel on Ubuntu 20.04 Focal Fossa via PPA”

  1. When I did this, I ended up with Kernel 5.17….. On booting up I found that the package for the Linux header was broken due to unmet dependencies. I run Ubuntu 20.04. Why does this happen and what can I do about it?

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.