Quantcast

How to Install Linux Kernel 5.17/5.18 on Fedora Linux 36

In most cases, Fedora is often up-to-date with the latest with the Linux Kernel. However, the Linux Vanilla repository is the go-to to grab the latest for users seeking the absolute latest cutting edge in kernel releases. The repository also handles the currently supported and in-development versions of Fedora. This is Fedora 34, 35, 36, and the future 37, so even if you change Fedora versions, you can still use this repository.

In the following tutorial, you will learn how to install the latest 5.17/5.18 Linux Kernel on Fedora 36 Server or Workstation using the Linux Vanilla third-party repository that is well known and downgrade back to the original Fedora kernel if you run into issues.

Update Fedora

First, ensure your system is up-to-date using the following command below; this is essential when installing kernels.

sudo dnf upgrade --refresh -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 36 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.17

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

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

Use the following command to set the stable repository for a higher priority than the default kernel repository.

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.17/5.18 on Fedora Linux 36

Type Y, then press the ENTER KEY to proceed.

Once done, reboot your system.

reboot

Once back, verify the kernel version installed.

cat /proc/version

Example output:

Install Linux Kernel 5.17/5.18 on Fedora Linux 36

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

Install Linux Kernel 5.18

WARNING, THIS KERNEL IS STILL IN RC/DEVELOPMENT MODE.

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

If you have enabled the kernel-vanilla-stable for Linux kernel 5.17, 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.17/5.18 on Fedora Linux 36

Type Y, then press the ENTER KEY to proceed.

Once done, reboot your system.

reboot

Once back, verify the kernel version installed.

cat /proc/version

Example output:

Install Linux Kernel 5.17/5.18 on Fedora Linux 36

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

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 Linux Vanilla Stable Kernel:

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

Disable Linux Vanilla Mainline 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, use the downgrade command to return to the Fedora Kernel.

sudo dnf downgrade kernel*

Alternatively, you could use the install command, but downgrade is preferred, but it is up to you.

Example output:

Install Linux Kernel 5.17/5.18 on Fedora Linux 36

Type Y, then press the ENTER KEY to proceed.

Next, reboot your system.

reboot

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

cat /proc/version

Example output:

Install Linux Kernel 5.17/5.18 on Fedora Linux 36

Now that you have restored the Fedora kernel list the kernels present on Fedora that are installed and not in use.

dnf list kernel

Example output:

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

Use the following command to remove both unused kernels.

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

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.17 or 5.18 on Fedora 36 Server or Workstation. Ideally, you should only use these on machines where hardware support is lacking, as sometimes kernels of this nature can bring in inconsistencies with Fedora on the odd occasion.



Follow LinuxCapable.com!

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