How to Check Linux Kernel Version (Simple Commands Explained)

What Is a Kernel in Linux?

Before checking your kernel version, it helps to know what a kernel actually is.

The Linux kernel is the core part of your operating system it connects your hardware (CPU, memory, storage) with the software you run.
Think of it as the bridge between your applications and your computer’s hardware.

Each new kernel release brings:

  • Better hardware support
  • Performance improvements
  • Security fixes
  • Stability updates

So, knowing which kernel version you’re running helps you troubleshoot issues, install compatible software, or confirm if you’re on a secure and updated version.


Check Kernel Version Using uname Command

The simplest and most commonly used method.

Command:

uname -r

Example Output:

6.8.0-45-generic

Here’s what each part means:

  • 6 → Major version
  • 8 → Minor version
  • 0 → Patch level
  • 45-generic → Distribution-specific build or configuration

You can also view additional system details with:

uname -a

Example Output:

Linux prats-server 6.8.0-45-generic #45~22.04.1-Ubuntu SMP x86_64 GNU/Linux

This shows the kernel version, build number, architecture, and OS details in one line.


Check Kernel Version with /proc/version

If you prefer exploring system files, Linux exposes kernel information in the /proc directory.

Command:

cat /proc/version

Example Output:

Linux version 6.8.0-45-generic (buildd@lcy02-amd64-010) (gcc (Ubuntu 13.2.0-23ubuntu3) 13.2.0) #45~22.04.1-Ubuntu SMP Wed Sep 18 13:21:00 UTC 2024

This method shows:

  • The kernel version
  • Compiler used to build it (e.g., GCC)
  • Build date and time

When to use it:
Useful when debugging or verifying custom-compiled kernels.


Check Kernel Version with hostnamectl

If your Linux system uses systemd (like Ubuntu, Fedora, or Debian newer versions), you can also use:

Command:

hostnamectl

Example Output:

Static hostname: prats-server
Icon name: computer-laptop
Chassis: laptop
Machine ID: e12345abcd6789f
Boot ID: a9876cdef54321
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 6.8.0-45-generic
Architecture: x86-64

This command shows the kernel version, OS, and hardware architecture in a clean format — perfect if you want a quick summary of system info.


Check Kernel Version Using lsb_release (Ubuntu/Debian)

While not directly for kernel info, this command helps cross-check the OS release with your kernel version.

Command:

lsb_release -a

Example Output:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

Combine it with uname -r to get both OS and kernel details side-by-side:

echo "Kernel: $(uname -r)"; lsb_release -a

Output:

Kernel: 6.8.0-45-generic
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

Check Kernel Version via dmesg (For Advanced Users)

The dmesg command shows kernel messages from the system log buffer.

To filter only kernel version info:

dmesg | grep Linux

Example output:

[    0.000000] Linux version 6.8.0-45-generic (buildd@lcy02-amd64-010) ...

Note:
You might need sudo privileges on some systems:

sudo dmesg | grep Linux

This is useful when you want to see boot-time kernel logs or confirm that the kernel loaded correctly.


Check Kernel Version with grubby (RHEL, CentOS)

On Red Hat or CentOS, you can list all installed kernels with:

sudo grubby --info=ALL | grep kernel

Example output:

kernel="/boot/vmlinuz-4.18.0-553.3.1.el8_10.x86_64"
kernel="/boot/vmlinuz-4.18.0-477.21.1.el8_8.x86_64"

This shows which kernel versions are installed — not just the one currently running.

To check the current kernel:

uname -r

Using GUI (for Desktop Users)

If you’re on a Linux desktop and prefer a graphical way:

On Ubuntu:

  1. Go to Settings → About
  2. Scroll to OS Name or Kernel Version

On Fedora:

  • Open Settings → About
  • You’ll find OS type and Kernel version

While not as flexible as the command line, this is the easiest method for beginners.


What Kernel Version Should You Use?

The kernel version affects performance, stability, and hardware support.

Here’s a general guideline:

User TypeRecommended Kernel
Desktop User (Ubuntu/Fedora)Latest stable version (6.x series)
Server AdminLTS (Long-Term Support) kernel for stability
DeveloperLatest mainline kernel for testing
Embedded DevicesCustom or lightweight kernel

You can always check the latest stable release on the official Linux Kernel Archive.


How to Know If You Need a Kernel Update

You might need to update your kernel if:

  • You’ve installed new hardware (Wi-Fi card, GPU) not detected by Linux
  • You’re troubleshooting performance or security issues
  • Your distro release notes mention kernel improvements

To check available kernel updates (Ubuntu/Debian):

sudo apt update
apt list --upgradable | grep linux-image

Or on Fedora:

sudo dnf list kernel

Summary of Commands to Check Kernel Version

CommandDescription
uname -rShows kernel version only
uname -aDisplays full system and kernel info
cat /proc/versionShows version, compiler, and build time
hostnamectlDisplays OS and kernel info together
`dmesggrep Linux`
grubby --info=ALLLists kernels on RHEL/CentOS

Example Use Case: Debugging a Driver Issue

Suppose your Wi-Fi adapter isn’t working after a system update.

You can check your kernel version:

uname -r

Output:

6.8.0-45-generic

Then, check online if your Wi-Fi chipset supports that kernel version.
If not, you may need to either:

  • Downgrade to an older kernel
  • Or install a compatible driver for the current kernel

This is a realistic example where knowing your kernel version can save hours of troubleshooting.


Conclusion

Checking your Linux kernel version takes just a few seconds, but it’s one of the most useful pieces of information when managing or troubleshooting a system.

The easiest and universal method is:

uname -r

Whether you’re debugging hardware issues, verifying updates, or comparing systems — knowing your kernel version helps you understand what’s running at the heart of your Linux system.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *