How to Install a Specific Kernel Version on Fedora

Install a specific kernel version on Fedora using dnf and update the bootloader configuration.

You need a different kernel

You just ran dnf upgrade and your laptop won't wake from suspend. Or your GPU driver crashed with a panic message pointing to the new kernel. You need to install a specific older kernel version to get back to a working state. Or you found a bug fix in a newer kernel that hasn't hit the stable updates yet, and you want to test it. Fedora makes this straightforward, but the package names and bootloader updates can trip you up if you don't know the exact syntax.

How Fedora manages kernels

Fedora installs kernels as separate packages. The system keeps multiple kernels installed by default. This is called the multiversion policy. When you install a new kernel, it doesn't delete the old one. It adds a new entry to the bootloader. The bootloader, GRUB, presents a menu at startup. You can choose which kernel to boot. Installing a specific version just means pulling that package from the repository and ensuring GRUB knows about it. The package manager handles most of the heavy lifting. You just need to ask for the right package name.

The kernel package is a meta-package. It depends on kernel-core and kernel-modules. When you install kernel-6.8.5-200.fc40, DNF pulls all three. This ensures the base kernel, the core modules, and the hardware-specific modules all match. If you install only kernel-core, the system won't boot correctly. Always install the kernel package.

Fedora's kernel packages include a post-install trigger that runs grub2-mkconfig automatically. You rarely need to run the bootloader update command by hand. If you do, you risk overwriting custom GRUB edits you made in /etc/default/grub. Trust the package manager to update the config.

Find the exact version string

Here's how to list available kernel versions so you can pick the exact one you need.

# List all available kernel packages in the enabled repositories
# The output shows package names, versions, and the repository source
# grep filters the list to show only the kernel packages
dnf list available kernel\* | grep -E "^kernel-"

The output lists packages like kernel.x86_64 6.8.5-200.fc40 updates. The version string includes the Fedora release suffix, such as fc40. You must use the full string. The repository requires the exact version including the suffix.

Install the kernel package

Once you have the version string, install the package using the exact name from the list.

# Install the specific kernel version
# Replace 6.8.5-200.fc40 with the version you found
# dnf will also install the matching kernel-modules and kernel-core packages
sudo dnf install kernel-6.8.5-200.fc40

DNF resolves dependencies automatically. It pulls the kernel, the modules, and the core package. The post-install trigger updates the GRUB configuration. You don't need to run grub2-mkconfig manually. If you see a message about grub2-mkconfig running in the output, that's the trigger doing its job.

Reboot and hold Shift. The GRUB menu lets you test the new kernel without changing the default.

Install from updates-testing

Sometimes the kernel you need is in updates-testing. This repository holds packages that are being tested before they hit the stable updates. You can enable it temporarily to install a specific version.

# Enable the updates-testing repository temporarily
# This allows dnf to see packages in the testing stream
# The --enablerepo flag applies only to this single command
sudo dnf --enablerepo=updates-testing install kernel-6.9.0-0.rc1.10.fc41

Packages in updates-testing are not guaranteed to be stable. They may contain regressions. Use this approach only when you need a specific fix or feature that isn't in the stable updates yet. Fedora's release cadence is six months. The testing stream moves fast. Check the bug tracker for known issues before installing a testing kernel on a production system.

Set the default boot entry

If you want this kernel to boot by default, update the GRUB default entry. Fedora uses grubby to manage boot entries. grubby is safer than editing GRUB files directly because it updates the environment block and the config file consistently.

# List all installed kernels and their GRUB indices
# The output shows the index, title, and kernel path for each entry
# The index is a number starting from 0
sudo grubby --info=ALL | grep -E "index|kernel"
# Set the default boot entry to the new kernel
# Replace 1 with the index of the kernel you want to boot by default
sudo grubby --set-default-index=1

The index corresponds to the order in the GRUB menu. Index 0 is usually the first entry. If you set the default to the new kernel, the system boots it automatically on the next restart. You can still select a different kernel from the menu if you hold Shift during boot.

Edit /etc/default/grub. Never edit /boot/grub2/grub.cfg directly. Manual edits drift and get overwritten by package updates.

Verify the running kernel

Confirm the system booted with the correct kernel version.

# Print the running kernel version
# The output must match the version you installed
# If it doesn't match, you booted the wrong entry
uname -r

Run uname -r first. If the version string doesn't match, you booted the wrong entry. Check the GRUB menu on the next reboot and select the correct kernel.

Common pitfalls

You see Error: No matching package to install: kernel-6.8.5. The repository requires the full release string including the Fedora version suffix. Use kernel-6.8.5-200.fc40, not kernel-6.8.5. The suffix tells DNF which release the package belongs to. Without it, DNF can't find the package.

You run grub2-mkconfig and your custom timeout disappears. The command regenerates the config from /etc/default/grub. If you edited /boot/grub2/grub.cfg directly, those changes are lost. Edit /etc/default/grub and run the config generator only if the package manager fails to update the menu. Fedora's kernel triggers handle this in almost all cases.

The system boots but the network is down. Some kernels change network interface naming or drop support for older drivers. Check journalctl -xe for driver errors. The x flag adds explanatory text and the e flag jumps to the end. Most sysadmins type journalctl -xeu <unit> muscle-memory style. If you see [FAILED] Failed to start NetworkManager.service during boot, your network configuration probably references a missing interface name.

Secure Boot blocks unsigned kernels. Fedora kernels are signed with the Fedora distribution key. If you install a kernel from a third-party repo, Secure Boot might block it. Stick to official Fedora repositories to avoid signature issues. If you must use a third-party kernel, you need to enroll the key or disable Secure Boot.

SELinux denials can block kernel modules. If a driver fails to load, check journalctl -t setroubleshoot before assuming the kernel is broken. A mislabeled module file can prevent loading even with the correct kernel version. SELinux denials show up in journalctl -t setroubleshoot with a one-line summary. Read those before disabling SELinux.

Installing a specific kernel adds it to the list. It doesn't remove the others. Fedora keeps the last three kernels by default. If you install many specific versions, your /boot partition can fill up. Check disk usage and remove old kernels if needed.

# List installed kernels
# The output shows all kernel packages currently on the system
rpm -qa | grep kernel
# Remove a specific old kernel
# Replace with the version you no longer need
# dnf will remove the kernel, modules, and core packages together
sudo dnf remove kernel-6.7.0-100.fc39

Check /boot usage before you install. A full partition blocks the kernel update.

When to use this approach

Use dnf install kernel-<version> when you need a specific older kernel to recover from a broken update or test a regression. Use dnf upgrade kernel when you want the latest stable kernel from the enabled repositories without touching other packages. Use dnf downgrade kernel when you want to revert to the previous kernel version and remove the newer one. Use grubby --set-default-index when you want to change which kernel boots automatically without uninstalling others. Stay on the default kernel when your system is stable and you have no driver issues. Fedora kernels receive security patches automatically.

Where to go next