How to Check the Linux Kernel Version: Commands and Practical Guide

Whether you are troubleshooting a driver issue, applying a security patch, or confirming that an application is compatible with your server, one of the first facts you need is your kernel version. The good news: on virtually any Linux system, you can find the kernel version in seconds with a single command. The most common way to know the Linux kernel version is to run `uname -r`, but there are several other commands that reveal more detail depending on what you are trying to learn.

This guide walks through every reliable method to find the kernel version on Linux, how to interpret the version string you get back, and why this small piece of information matters for security, compatibility, and stability.

Key Takeaways
• Run `uname -r` for the kernel release on its own (e.g. `5.15.0-91-generic`) — this is the fastest, most portable method.
• Use `uname -a` for the full picture: kernel, hostname, architecture, and build date.
• On systemd distributions, `hostnamectl` shows both the kernel and the OS in one view.
• The kernel version is not the same as your distro/OS version — they update on separate cycles, so check both when diagnosing problems.
• Knowing your kernel version is essential for security patches (CVEs), driver compatibility, and deciding whether to update.

What is the fastest way to know the Linux kernel version?

The single most widely used command is `uname` (short for “Unix name”) with the `-r` flag, which prints the kernel release:

“`bash uname -r “`

Typical output:

“` 5.15.0-91-generic “`

That is it — one line, the kernel release string. The `uname` command is part of the coreutils package and is present on essentially every Linux distribution, so this method works identically on Ubuntu, Debian, CentOS, Rocky Linux, Fedora, Arch, and almost anything else.

If you want a little more context without the full system dump, combine flags:

“`bash uname -mrs “`

Output:

“` Linux 5.15.0-91-generic x86_64 “`

Here you get the kernel name (`Linux`), the release (`5.15.0-91-generic`), and the machine architecture (`x86_64`), all on one line.

How do you find all system and kernel information at once?

When you want everything `uname` knows in a single shot, use the `-a` (“all”) flag:

“`bash uname -a “`

Output:

“` Linux web-server-01 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux “`

Reading left to right, this gives you the kernel name, the hostname (`web-server-01`), the kernel release, the kernel version/build string (`#101-Ubuntu SMP … 2023`, including the build date), the architecture repeated for hardware/processor/platform, and the operating system family. This is the command to reach for when you are filing a bug report or asking for support, because it captures the kernel build details in one place.

Reading the version string

A release like `5.15.0-91-generic` is not random — it follows a predictable structure:

  • `5` — the major version.
  • `15` — the minor version.
  • `0` — the patch level (sometimes called the revision).
  • `-91` — the distribution build (or ABI) number, incremented as your distro ships kernel updates.
  • `-generic` — the kernel flavor, indicating the variant (e.g. `generic`, `lowlatency`, `aws`, `azure`).

So `5.15.0-91-generic` reads as: mainline kernel 5.15.0, packaged as build 91, in the generic flavor. When you compare two systems or check whether a patch is applied, the build number (`-91`) is often what changes between updates while the `5.15.0` base stays the same.

What other commands show the kernel version?

`uname` is the go-to, but several other sources expose the kernel version, each with its own extras.

Reading /proc/version

The `/proc` filesystem is a window into the running kernel. The `/proc/version` file holds the kernel string plus the compiler and full build details:

“`bash cat /proc/version “`

Output:

“` Linux version 5.15.0-91-generic (buildd@lcy02-amd64-045) (gcc (Ubuntu 11.4.0) …) #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 “`

This is the most detailed view of the running kernel — useful when you need to know which GCC version compiled it or who built it.

Using hostnamectl on systemd distributions

On modern distributions that use systemd (Ubuntu 16.04+, Debian 9+, CentOS/RHEL 7+, Fedora, and most others), `hostnamectl` summarizes both the OS and the kernel together:

“`bash hostnamectl “`

Output (abbreviated):

“` Static hostname: web-server-01 Operating System: Ubuntu 22.04.3 LTS Kernel: Linux 5.15.0-91-generic Architecture: x86-64 “`

Notice that this command shows the Operating System and the Kernel as two distinct lines. That distinction is the heart of one of the most common points of confusion (more on that below).

Querying the kernel package directly

You can also ask your package manager which kernel package is installed, which is handy for distinguishing the installed kernel from the one currently running.

On Debian/Ubuntu (dpkg/APT):

“`bash dpkg –list | grep linux-image “`

On RHEL/CentOS/Rocky/Fedora (rpm/DNF):

“`bash rpm -qa | grep kernel “`

These list every kernel package on the system, including older versions you may not have booted into yet.

Command reference table

Command What it shows
`uname -r` Kernel release only (e.g. `5.15.0-91-generic`) — most common
`uname -a` All info: kernel, hostname, architecture, build date
`uname -mrs` Release + architecture + kernel name
`cat /proc/version` Kernel + compiler (GCC) + full build details
`hostnamectl` Kernel and OS together (systemd distros)
`dpkg –list \ grep linux-image` Installed kernel packages (Debian/Ubuntu)
`rpm -qa \ grep kernel` Installed kernel packages (RHEL/CentOS/Fedora)

Why does it matter to know your kernel version?

Knowing your kernel version is not trivia — it directly affects how you secure and maintain a server.

  • Security patches and CVEs. Kernel vulnerabilities (tracked as CVEs) are patched in specific releases. To confirm whether you are exposed to a known flaw, you compare your running version against the version that contains the fix.
  • Driver and hardware compatibility. Drivers — especially for storage controllers, network cards, and GPUs — are often tied to kernel versions. A driver may require a minimum kernel, and module ABIs can change between releases.
  • Software and feature compatibility. Container runtimes, filesystems, and certain applications require kernel features that only exist above a particular version.
  • Support and troubleshooting. Vendor support and community forums almost always ask for your exact kernel version before they can help.
  • Deciding whether to update. You can only judge whether an update is needed if you know where you currently stand.

The kernel version is not your distro version

Here is the single most important thing to understand, and the source of countless support tickets: the Linux kernel version and your distribution/OS version are two separate things that update on different cycles.

When you run `uname -r` and see `5.15.0`, that is the kernel. When you see Ubuntu 22.04 (or Debian 12, Rocky Linux 9, and so on), that is the operating system release — the distribution’s userland, package set, and branding. They are maintained independently:

  • A single OS release can ship many kernel builds over its lifetime. Ubuntu 22.04 might run `5.15.0-60` today and `5.15.0-91` after updates, while still being “22.04” the whole time.
  • Conversely, the same kernel series can appear across multiple distributions.

This is why `hostnamectl` deliberately prints them on separate lines. When you are troubleshooting a compatibility or security issue, check both: a piece of software may need “Ubuntu 22.04 or later” *and* “kernel 5.10 or later,” and those are different requirements. Confusing the two leads people to apply the wrong fix — upgrading the distro when only a kernel update was needed, or vice versa.

How do you check installed kernels and update them?

To see which kernels are installed (so you know your rollback options), use the package queries shown earlier. The kernel you are running comes from `uname -r`; the kernels installed come from `dpkg`/`rpm`. These can differ if you have updated but not yet rebooted.

Updating the kernel is distribution-dependent, but in broad strokes it happens through your normal package manager:

“`bash

sudo apt update && sudo apt upgrade

sudo dnf upgrade “`

A new kernel typically requires a reboot to take effect, since the running kernel cannot be swapped live without special tooling (such as livepatch services). After rebooting, run `uname -r` again to confirm you booted into the new version. Always make sure you have a working previous kernel and a backup before a kernel upgrade on a production server.


Manage your kernel with full root access on DarazHost

To check, manage, and update your kernel freely, you need root access to the server — something shared hosting rarely provides. DarazHost VPS and dedicated server plans give you exactly that: full control over your server’s software stack, so you can run `uname -r`, apply security patches, install the kernels and drivers your workloads need, and reboot on your own schedule. Combined with reliable, up-to-date infrastructure and 24/7 support, DarazHost lets you keep your kernel current for both compatibility and security without fighting your host for permissions.


Frequently asked questions

Which command should I use to know the Linux kernel version? For most purposes, run `uname -r`. It prints the kernel release on its own and works on every distribution. If you also want the OS name alongside the kernel, use `hostnamectl` on systemd-based systems.

How do I find the kernel version without uname? Run `cat /proc/version` to read the kernel string directly from the `/proc` filesystem, or use `hostnamectl` on systemd distributions. Both show the running kernel without calling `uname`.

What does the number in 5.15.0-91-generic mean? It breaks down as `major.minor.patch-build-flavor`: `5` is major, `15` is minor, `0` is patch, `-91` is the distribution build number, and `-generic` is the kernel flavor (variant). The build number usually increments with each distro kernel update.

Is the kernel version the same as my Ubuntu or CentOS version? No. The kernel version (`uname -r`) and the OS/distribution version (such as Ubuntu 22.04) are separate and update on different schedules. Always check both when verifying compatibility or security requirements.

How do I know if I need to update my kernel? Compare your running version (`uname -r`) against the version that contains the security fix or feature you need, then update through your package manager (`apt` or `dnf`) and reboot. Knowing your current version is the prerequisite for that decision.

About the Author

Leave a Reply