How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

Linux Kernel 5.17 has been released with support for recursive id-mapped mounts; CO-RE support that creates compiled BPF programs more portable; a replacement P-state driver for contemporary AMD CPUs; the random number generator switched to BLAKE2s and got much faster; a replacement Real-Time Linux Analysis tool; the fscache networking caching backend was rewritten; new fanotify flag to interchange some inotify patterns; support for giving names to anonymous memory mappings.

Many other improvements have been included in the release, far too long to list. Please review Linux 5.17 Kernel release changelog for detailed changes before installing the new kernel.

In the following tutorial, you will learn how to install the latest 5.17 Linux Kernel on Linux Mint 20 LTS series based on Ubuntu 20.04 LTS Focal Fossa using the command line terminal and how to remove and restore the original kernel.

Update Linux Mint

Before you begin, update your system to ensure all existing packages are up to date, as this is essential when installing/upgrading Linux kernels to avoid conflicts.

sudo apt update && sudo apt upgrade

Optional – Create a Snapshot of System

Next, proceed to the installation of the Linux Kernel. Make sure that any sensitive documents are backed up if anything goes wrong with TimeShift.

For users new to Linux Mint and who do not know about TimeShift, this can be found by the following path.

(Bottom left-hand corner) Taskbar > Administration > TimeShift

Follow the prompts, and it is pretty straightforward; you should set up an automatic job regardless if you do not install the kernel, as it can save you if an installation of any kind goes wrong in most situations.

Example:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

Install Linux Kernel 5.17 – PPA Method

Import TuxInvader PPA

The first option to install the Linux 5.17 kernels is to install the ppa:tuxinvader/lts-mainline by TuxInvader. This has some of the most up-to-date 5.17, and the previous 5.16 kernel builds and is often updated regularly.

The drawback is that this is an untrusted PPA and not an official release by the Ubuntu teams, but given the history of the PPA, it is safe as any other reputable PPA.

First, install the LTS Mainline Tuxinvader PPA as follows.

sudo add-apt-repository ppa:tuxinvader/lts-mainline -y

Once installed, update your repository list.

sudo apt update

Install Linux Kernel 5.17 from Tux PPA

Next, install the 5.17 generic Linux kernel drivers by executing the following command.

sudo apt-get install linux-generic-5.17 -y

Once complete, you will need to reboot your system for the new kernel to be fully activated.

reboot

Once logged back into your system, run the following command to confirm the new kernel version is running.

sudo uname -r

Example output:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

For people that love pretty printouts, install the neofetch package.

sudo apt install neofetch -y

Now print your system specs that will show the kernel version as follows.

neofetch

Example output:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

Install Linux Kernel 5.17 – Ubuntu Mainline Repo

The second option is to install the Linux Kernel is to download the .deb package from the Ubuntu mainline repository manually. This works well, but you will need to keep the maintenance up when new updates arise by manually re-installing the new kernel packages.

First, visit the Ubuntu Mainline Kernel 5.17 Repository and find the latest version; available is AMD64, ARM64, ARMHf, ppc64el, and s390x. The most common will be AMD64 for most users.

Example:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

Next, download the required packages using the wget command.

Example (ONLY DO NOT USE):

Required for AMD64 users:

wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/linux-image-unsigned-5.17.0-051700-generic_5.17.0-051700.202203202130_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/linux-modules-5.17.0-051700-generic_5.17.0-051700.202203202130_amd64.deb

Optional Extras for AMD64 users:

wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/linux-headers-5.17.0-051700_5.17.0-051700.202203202130_all.deb

Handy tip for s390x, ppc64el, armhf, and arm64 users, change the https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/ to https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/{alternative architecture/ or grab the links from the download page.

The required packages are what they mean, and you need to download those to install the Linux Kernel. The optional extras include support for DKMS modules and can be recommended to install for Desktop users.

Next, in the folder you downloaded the new Linux Kernel packages, give the packages executable permission using the following blanket command.

sudo chmod +x *.deb

Now begin the installation using the dpkg -i command.

sudo dpkg -i *.deb

Once complete, you will need to reboot your system for the new kernel to be fully activated.

reboot

Once logged back into your system, run the following command to confirm the kernel version is running.

sudo uname -r

Example output:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

And that’s it; you have successfully installed the latest Linux Kernel 5.17.

How to Restore Default Kernel

For users who find the new kernel has bugs for their hardware, say, loss of sound, use the following steps to restore the default kernel; if you installed an alternative kernel, replace the default kernel section with whatever you want install.

For users that installed the Tux PPA Mainline kernel, you must remove the repository by adding the –remove syntax to the previous add command.

sudo add-apt-repository --remove ppa:tuxinvader/lts-mainline -y

Now run an APT update.

sudo apt update

To begin the removal and restoration, use the following command.

sudo apt-get autoremove linux-generic-5.17* linux-headers-5.17* linux-image-unsigned-5.17* linux-modules-5.17* -y

Next, you will see the following prompt advising that you must make sure a kernel is installed or re-installed before you reboot if you remove the current kernel. Otherwise, your system will be destroyed, unbootable, broken, etc.

Example:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

Press the tab key, select <No>, and press the ENTER KEY.

DO NOT REBOOT. I REPEAT, DO NOT REBOOT YET, OR ELSE DO NOT CRY IF YOUR SYSTEM GETS BORKED.

Before we reboot, make sure the default generic is installed, do not fuss too much as you can install alternative versions later on as we are just trying to get your system back to working order.

Use the following command to make sure the default kernel is installed; at the time, this is Linux kernel 5.4.

sudo apt install --install-recommends linux-generic -y

Now, you may notice it will show an output saying this is already installed, and then you did not remove the kernel after installing Linux Kernel 5.17; users who did this will re-install the latest recommended kernel for Linux Mint 20 LTS.

Example:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

Now reboot.

reboot

Optionally, you can install the kernel-generic HWE version, which is 5.13, for those seeking an upgrade that is considered more stable and is what Ubuntu 20.04 LTS currently runs on.

sudo apt install --install-recommends linux-generic-hwe-20.04 -y

If you did not install the HWE 5.13 kernel above, skip another reboot.

reboot

Now verify the kernel installed, which should be the default generic kernel.

sudo uname -r

Example output:

How to Install Linux Kernel 5.17 on Linux Mint 20 LTS

As above, you have fallen back to the default kernel. If you installed the HWE Linux kernel, the output should be 5.13 instead of 5.4.

Alternative Kernels

For those that want different options besides the PPA or manually installing, check out the following custom kernel tutorials, which often boast the latest Linux custom-built kernels.

Comments and Conclusion

In the tutorial, you have learned how to install the latest 5.17 kernel on your Linux Mint 20 series desktop. Note, if your system is a production server, it would be advised to use the existing kernel that ships the standard installation for the most stability.

However, for those wanting to try kernel 5.17, take backups as many jump ahead sometimes and regret the decision. Ensure that the users who manually install the .deb packages keep checking for updates.



Follow LinuxCapable.com!

Like to get automatic updates? Follow us on one of our social media accounts!