Quantcast

Install Linux Kernel 5.16/5.17 on Fedora Linux 34/35

Linux kernel 5.16 has many new features, support, and security. The Linux 5.16 kernel release has a great new feature, FUTEX2, or futex_watv(), which aims to improve the Linux gaming experience, growing considerably with better native Linux porting for Windows games utilizing Wine.

Other improvements have seen improved write congestion management task scheduler for CPU clusters sharing L2/L3 cache, among others. More information can be found on the Linux 5.16 Kernel release changelog.

In the following tutorial, you will learn how to install the latest 5.16/5.17 Linux Kernel on Fedora 34/35 Server or Workstation using the Linux Vanilla third-party repository that is well known.

Prerequisites

  • Recommended OS: Fedora Linux 35.
  • User account: A user account with sudo or root access.
  • Internet Access
  • CPU Architecture:
    • aarch64
    • x86_64

The tutorial will utilize the terminal, which can be found in your show applications menu.

Example:

Install Linux Kernel 5.16-5.17 on Fedora 35

Update Operating System

Update your Fedora operating system to make sure all existing packages are up to date:

sudo dnf upgrade --refresh -y

The tutorial will be using the sudo command and assuming you have sudo status.

To verify sudo status on your account:

sudo whoami

Example output showing sudo status:

[joshua@fedora ~]$ sudo whoami
root

To set up an existing or new sudo account, visit our tutorial on Adding a User to Sudoers on Fedora.

To use the root account, use the following command with the root password to log in.

su

Install Dependency Required

Before proceeding with the installation, run the following command to ensure the following packages are installed.

sudo dnf install dnf-plugins-core curl -y

Import Linux Vanilla Kernel Repo

Fedora often is up to date with the latest stable kernels. Usually, you will find upgrade kernels from Fedora in the testing repository or rawhide for future kernels, but they do not release overnight, even by Fedora’s standards.

For users that would like a quicker turnaround with using an RPM and not using the alternative XanMod or Liquorix type kernels or compiling your own, which for some users may be too complex or too time-consuming, the Linux Vanilla repo is often up to date with stable and mainline kernels and is well known.

To import the repository on your Fedora 35 system, use the following command.

curl -s https://repos.fedorapeople.org/repos/thl/kernel-vanilla.repo | sudo tee /etc/yum.repos.d/kernel-vanilla.repo

Install Linux Kernel 5.16 on Fedora

Currently, Linux Kernel 5.16 is featured on the stable branch. To begin the installation, use the following command.

sudo dnf config-manager --set-enabled kernel-vanilla-stable

To set the stable repository for a higher priority than the default kernel repository, use the following command.

sudo dnf config-manager --save --setopt="kernel-vanilla-stable.priority=99"

Confirm that the priority was added.

grep priority /etc/yum.repos.d/kernel-vanilla.repo

Example output:

priority=99

None of the other repositories should have any priorities set by default, so you know the repository setup is successful if this is present.

Now install/upgrade the Linux kernel.

sudo dnf upgrade kernel* --refresh

Example output:

Install Linux Kernel 5.16-5.17 on Fedora 35

Type Y, then press the ENTER KEY to proceed.

Once done, reboot your system.

sudo reboot

Once back, verify the kernel version installed.

cat /proc/version

Example output:

Install Linux Kernel 5.16-5.17 on Fedora 35

Congratulations, you have installed the latest Linux Kernel, 5.16.

Install Linux Kernel 5.17 on Fedora

WARNING, THIS KERNEL IS STILL IN RC/DEVELOPMENT MODE, BE PREPARED FOR BUGS ISSUES MORE THAN 5.16.

For those who want to live on the edge, The Linux Vanilla Mainline repository features the latest mainline builds that currently boasts the newest release candidate, 5.17, and this will see 5.18, 5.19, etc.

Now, if you have enabled the kernel-vanilla-stable for Linux kernel 5.16, disable it.

sudo dnf config-manager --set-disable kernel-vanilla-stable

Now enable the kernel-vanilla-mainline.

sudo dnf config-manager --set-enabled kernel-vanilla-mainline

Set the priority for the new kernel repository to be higher than any other repository.

sudo dnf config-manager --save --setopt="kernel-vanilla-mainline.priority=99"

Now install/upgrade the Linux kernel.

sudo dnf upgrade kernel* --refresh

Example output:

Install Linux Kernel 5.16-5.17 on Fedora 35

Type Y, then press the ENTER KEY to proceed.

Once done, reboot your system.

sudo reboot

Once back, verify the kernel version installed.

cat /proc/version

Example output:

Install Linux Kernel 5.16-5.17 on Fedora 35

Congratulations, you have installed the latest Linux Kernel, 5.17.

Alternative Method for Linux Kernel 5.17

For those wanting to use the Fedora rawhide kernel version, visit How to Install Linux Kernel 5.17 on Fedora 35.

How to Restore Fedora Default Kernel

The below steps will show you a method to remove the installed third-party kernels and restore the default Fedora kernel. There may be other alternative ways, and this method will work as shown below.

First, disable the enabled Linux Vanilla repository.

Disable 5.16 Linux Vanilla Kernel:

sudo dnf config-manager --set-disable kernel-vanilla-stable

Disable 5.17 Linux Vanilla Kernel:

sudo dnf config-manager --set-disable kernel-vanilla-mainline

Next, remove the Linux Vanilla repo.

sudo rm /etc/yum.repos.d/kernel-vanilla.repo

Next, list the kernels present on Fedora.

dnf list kernel

Example output:

Install Linux Kernel 5.16-5.17 on Fedora 35

The tutorial has both 5.16 and 5.17 installed from Kernel Vanilla.

Use the following command to remove both and fall back to the default Fedora kernel.

WARNING, DO NOT REBOOT AFTER REMOVING KERNELS. YOU NEED TO RE-INSTALL THE DEFAULT KERNEL.

sudo dnf --setopt=protected_packages= remove $(rpm -q kernel-core | grep -v $(uname -r))

Next, re-install the Fedora Kernel.

sudo dnf install kernel kernel-headers kernel-modules kernel-modules-extra

Example output:

Install Linux Kernel 5.16-5.17 on Fedora 35

Type Y, then press the ENTER KEY to proceed.

Next, reboot your system.

sudo reboot

Once logged back in, verify the installed kernel using the cat command again.

cat /proc/version

Example output:

Install Linux Kernel 5.16-5.17 on Fedora 35

Another good command to run distro-sync. The command is good for removing large or core level packages such as kernels and getting your Fedora system back on track.

sudo dnf distro-sync -y

Comments and Conclusion

In the tutorial, you have learned how to install the latest Linux Kernel 5.16/5.17 on Fedora 34/35 Server or Workstation. Currently, Fedora 34 will be EOL soon, so the support for the kernel using Linux Vanilla will end once Fedora 36 is released; keep this in mind.



Follow LinuxCapable.com!

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