The Linux kernel is the core component that bridges a computer‘s software with its hardware. All operating system services, applications, and driver connectivity rely on this central piece of code.
On Fedora Linux distributions, the kernel handles vital tasks like:
- Memory allocation and process scheduling
- Facilitating inter-process communication
- Enforcing security policies and access controls
- Managing file systems and disk operations
- Enabling networking and internet connectivity
- Supporting input/output (I/O) from devices
- Maintaining overall system performance
With such an extensive feature set, it‘s important to keep the kernel updated. This guide will teach you how to check Fedora kernel versions using various built-in tools. You‘ll also learn multiple methods to upgrade the kernel manually or via automated package managers.
Why Updating Fedora‘s Kernel Matters
According to Linux security researchers, outdated kernels expose systems to exploits like:
- Memory corruption bugs: flaws that enable arbitrary code execution.
- Privilege escalation attacks: exploits that allow unauthorized root access.
- Denial of service vulnerabilities: bugs that crash systems or networks.
- Hardware/driver issues: incompatibilities with newer components.
Moreover, newer kernels offer:
- Performance improvements: faster I/O, networking, etc.
- Enhanced feature set: access to newer hardware capabilities.
- Architectural optimizations: boosts on modern CPU instruction sets.
- Power management additions: longer battery life on laptops.
- File system developments: better reliability and speed.
As Fedora‘s documentation notes, timely kernel upgrades should be part of any admin or user‘s regular system maintenance.
Now let‘s explore your options for checking kernel versions on Fedora.
Available Tools for Checking the Fedora Kernel Version
Fedora installations come loaded with various utilities that can verify kernel release details:
| Tool | Description | Example Output |
|---|---|---|
uname |
Prints currently running kernel information. | 5.17.5-200.fc36.x86_64 |
neofetch |
Shows visually formatted system details, including kernel. | Kernel: 5.17.5-200.fc36.x86_64 |
rpm |
Queries the package manager database for installed kernel packages. | kernel-5.17.5-200.fc36.x86_64 |
hostnamectl |
Reveals hostname settings and kernel version. | Kernel: Linux 5.17.5-200.fc36.x86_64 |
/proc/version |
Checks kernel version from a virtual file with system details. | Linux version 5.17.5-200.fc36.x86_64 |
grubby |
Gets default kernel boot configuration info. | /boot/vmlinuz-5.17.5-200.fc36.x86_64 |
I‘ll now demonstrate examples of how administrators can leverage these tools to verify kernel release levels prior to upgrading.
Using the uname Command
As one of the most ubiquitous Linux utilities, uname prints detailed information about a system‘s kernel, hosts name, hardware platform, and more.
For example, running:
$ uname -r
Returns output just for the running kernel‘s release number:
5.17.5-200.fc36.x86_64
We can decipher details from this as:
- 5: Kernel major version
- 17: Minor version
- 5: Patch number
- 200.fc36: Fedora 36 build variant
- x86_64: 64-bit x86 architecture
Adding the -v flag fetches the kernel‘s compile date/time:
$ uname -v
#1 SMP Tue Mar 1 16:11:06 UTC 2022
This quickly verifies we have the latest stable Fedora 36 kernel release.
neofetch for Stylish Kernel Reporting
Neofetch generates an elegant terminal-based system report with details like:
$ neofetch
Linux localhost 5.17.5-200.fc36.x86_64 #1 SMP Tue Mar 1 16:11:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Kernel: 5.17.5-200.fc36.x86_64
The key bit is under "Kernel" which matches our uname output from earlier. Neofetch even includes specific compile flags.
To install on Fedora:
$ sudo dnf install neofetch
Now you can stylishly verify kernel versions pre/post upgrades.
Leveraging Fedora‘s rpm Database
The rpm tool manages software packages at a low level, tracking details in its database. We can query it to list all installed kernel packages via:
$ rpm -q kernel
kernel-5.17.5-200.fc36.x86_64
kernel-core-5.17.5-200.fc36.x86_64
This quickly retrieves a list of kernel packages, along with their exact numbered releases. The kernel-core package contains the kernel binary itself while kernel is a meta package that depends on kernel-core.
hostnamectl for Kernel Details
The hostnamectl program manages hostname configuration. But it also reports system specifications like:
$ hostnamectl
Kernel: Linux 5.17.5-200.fc36.x86_64
So with a single command, you can check both the hostname settings and confirm if the kernel matches expected version releases from your other checks.
Examining /proc/version
This virtual file exposes diagnostic information from the procfs pseudo file system. Among other system particulars, it shows:
$ cat /proc/version
Linux version 5.17.5-200.fc36.x86_64
Providing an additional method to cross-reference the running kernel‘s release status.
grubby to View Default Kernel Targets
When dual booting multiple kernels, Linux bootloaders need to know which one to load by default upon restart. The grubby tool manages these configurations.
To show the default kernel target, use:
$ sudo grubby --default-kernel
/boot/vmlinuz-5.17.5-200.fc36.x86_64
This reveals which kernel bootloader entries are active, before and after updates.
Now that you understand the various tools at your disposal for checking kernel version numbers, let‘s move on upgrading Fedora‘s kernel.
How to Update the Kernel on Fedora
I suggest relying on Fedora‘s own DNF package manager to handle kernel upgrades. DNF integrates closely with Fedora software repositories, safely upgrading the kernel and its dependencies during general system updates.
However, learning how to manually install kernel packages also proves useful in many cases. I‘ll cover both below.
Upgrading Fedora‘s Kernel Via DNF System Updates
DNF manages software packages from Fedora repositories. To update all packages, including the latest kernel:
$ sudo dnf upgrade
DNF connects to Fedora mirrors, fetches package metadata, compares versions, then upgrades programs if newer releases exist. This includes the kernel and kernel-core packages too.
Over time, major kernel version jumps indicate significant changes:
| Fedora Release | Kernel Version | Release Date |
|---|---|---|
| Fedora 19 | 3.11 | 2013 |
| Fedora 20 | 3.13 | 2013 |
| Fedora 26 | 4.11 | 2017 |
| Fedora 28 | 4.16 | 2018 |
| Fedora 33 | 5.8 | 2020 |
| Fedora 36 | 5.17 | 2022 |
So staying on top of DNF system updates ensures you regularly receive the latest kernel packages from the Fedora repositories.
Manually Installing Different Kernel Versions
At times, you may wish to upgrade your kernel manually – independent of other system updates. Or switch between multiple installed versions.
First, check currently available candidates:
$ sudo dnf list kernel*
Kernel-tools.x86_64 5.17.5-200.fc36
Kernel-tools-libs.x86_64 5.17.5-200.fc36
Kernel-tools-libs-devel.x86_64 5.17.5-200.fc36
kernel.x86_64 5.17.5-200.fc36
Then install your chosen kernel package:
$ sudo dnf install kernel-5.17.11-300
This fetches a specific kernel release, leaving other packages untouched.
Alternatively, compile and install a custom kernel from source code. But this process is complex with dozens of configuration flags. Stick to the standard Fedora kernel packages when possible.
Finally, reboot to load your new kernel:
$ sudo reboot
On login, double check your current kernel version with uname -r to verify upgrades completed.
Setting a Different Default Kernel Target
During kernel upgrades, your previous version remains installed as a fallback. If you maintain multiple kernel versions, Linux needs to know which one to load on reboot.
Use grubby to show the currently default entry:
$ sudo grubby --default-kernel
/boot/vmlinuz-5.17.5-200.fc36.x86_64
List all installed kernels:
$ grubby --info=ALL
Then set your desired default:
$ sudo grubby --set-default /boot/vmlinuz-5.15.14-200.fc36.x86_64
This configures your bootloader to load the 5.15 kernel instead of the latest 5.17 release.
Reboot to apply the changes. Run uname -r to confirm your bootloader updated correctly after logging back in.
Key Pros and Cons of Upgrading Kernels via Package Managers vs Manual Installs
In summary, here are some top advantages of leveraging DNF to handle kernel upgrades:
Pros
- Fully automates upgrades of kernel and dependencies.
- Integrates closely with Fedora repositories.
- Handles falling back to previous kernel if issues emerge.
- Simpler and less error prone.
Cons
- Not as flexible for specific kernel versions.
- Upgrades all packages rather than just the kernel.
- Can‘t customize kernel parameters/modules.
Whereas manually installing kernel packages offers:
Pros
- Choose exact kernel versions.
- Build and deploy custom kernels.
- Select individual packages to upgrade.
- Supports custom module and config options.
Cons
- More complex with risk of dependency issues.
- Manual installs don‘t fallback safely.
- Compiling custom kernels is challenging.
Evaluate these tradeoffs and choose the most appropriate approach per use case. Utilize the skills covered here to ensure you upgrade kernels safely.
Final Thoughts on Updating Fedora Kernels
I hope this guide has demystified options for checking and upgrading kernel versions on Fedora Linux. Keeping your kernel current remains crucial for performance, security, hardware support, and stability.
Leverage utilities like uname, neofetch, rpm, and /proc/version to validate kernel release numbers pre and post installs. When the time comes for upgrades, rely on Fedora‘s DNF package manager to smoothly transition during general system updates.
But also recognize when to directly install specific kernel packages – if you need to pin a particular version, customize configs, or evaluate new releases separately from other system packages.
As Linux continues to evolve, remember to stay vigilant and keep your Fedora kernels up-to-date! Let me know if you have any other questions.


