How to Check the Kernel Version in Linux

By 

•

Updated on

•

5 min read

Check the Linux kernel version from the command line

Knowing which kernel version is running on your system helps when troubleshooting hardware issues, checking whether a security patch applies, or verifying driver compatibility. This guide covers several ways to check the Linux kernel version from the command line, explains what each part of the version string means, and shows how to tell whether a newer kernel is installed but not yet running.

Using the uname Command

The uname command displays system information including the kernel name, version, and architecture.

The quickest way to print just the kernel release is uname -r:

Terminal
uname -r
output
7.0.0-31-generic

For more detail, add the -s and -m flags to include the kernel name and machine hardware:

Terminal
uname -srm
output
Linux 7.0.0-31-generic aarch64

The output shows that this system runs kernel 7.0.0-31 on 64-bit ARM hardware (aarch64). On most PCs and cloud servers, you will see x86_64 in that field instead. The components of the version string are:

  • 7 - Major version.
  • 0 - Minor version (also called patchlevel).
  • 0 - Sub-level (bug-fix increment).
  • 31 - ABI number, set by the distribution.
  • generic - Build flavor set by the distribution.

On Ubuntu, the sub-level always stays at 0, even after the kernel picks up upstream stable fixes. To find out which upstream release an Ubuntu kernel is built on, read /proc/version_signature:

Terminal
cat /proc/version_signature
output
Ubuntu 7.0.0-31.31-generic 7.0.14

The last field tells us that this kernel is based on upstream Linux 7.0.14. In 31.31, the first number is the ABI number and the second is the upload number, which increases with every new build of the kernel package. Only Ubuntu kernels provide this file.

To print all available system information at once, use uname -a.

Using the hostnamectl Command

The hostnamectl utility is part of systemd. It is used to query and change the system hostname, but it also shows the Linux distribution and kernel version. Use this method on systemd-based systems:

Terminal
hostnamectl
output
 Static hostname: ubuntu
       Icon name: computer-vm
         Chassis: vm 🖴
      Machine ID: 45c238ad5c9746c7a8546ad02077864a
         Boot ID: f0195541b77c49a1bdae4ac6641d888d
  Virtualization: qemu
Operating System: Ubuntu 26.04.1 LTS
          Kernel: Linux 7.0.0-31-generic
    Architecture: arm64
 Hardware Vendor: QEMU
  Hardware Model: QEMU Virtual Machine
Hardware Version: virt-11.1
Firmware Version: edk2-stable202408-prebuilt.qemu.org
   Firmware Date: Tue 2024-08-13
    Firmware Age: 2y 2month 1w 3d

The Kernel line shows the same release as uname -r, and the Operating System line gives you the distribution name and version in the same output. If you need more ways to find the distribution release, see our guide on checking the Linux version .

You can use the grep command to filter the kernel line:

Terminal
hostnamectl | grep -i kernel
output
          Kernel: Linux 7.0.0-31-generic

If hostnamectl is not available on your system, use uname -r or cat /proc/version instead.

Using the /proc/version File

The /proc directory contains virtual files with information about system memory , CPU cores , mounted filesystems , and more. The running kernel version is stored in /proc/version.

Use cat or less to display the file:

Terminal
cat /proc/version
output
Linux version 7.0.0-31-generic (buildd@bos03-arm64-028) (aarch64-linux-gnu-gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, GNU ld (GNU Binutils for Ubuntu) 2.46) #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Aug  1 03:33:01 UTC 2026

This output includes the compiler version and build date, which can be useful when verifying that a specific kernel patch was applied.

Checking Installed Kernels

All of the commands above report the kernel that is running right now. A system usually has more than one kernel installed, and when a kernel update arrives, the new kernel is used only after the next reboot. Checking the installed kernels tells you whether the system is running the newest one.

On Ubuntu, Debian, and Derivatives, list the kernel packages with dpkg :

Terminal
dpkg --list 'linux-image-*' | grep -E '^ii[[:space:]]+linux-image-(unsigned-)?[0-9]'
output
ii  linux-image-7.0.0-31-generic 7.0.0-31.31  arm64        Signed kernel image generic

Each line is one installed kernel. The filter matches versioned package names beginning with linux-image- or linux-image-unsigned- and skips meta-packages such as linux-image-generic or linux-image-virtual, which only pull in the newest kernel and are not kernels themselves. The ^ii at the start of the filter hides kernels that were removed but left their configuration files behind. This system has a single kernel, and it matches the uname -r output.

On Fedora, RHEL, and Derivatives, query the kernel package with rpm :

Terminal
rpm -q kernel

The command prints one kernel-VERSION line for each installed kernel. By default, dnf keeps the three most recent kernels and removes the oldest one when a new kernel is installed.

On most distributions, the /boot directory also holds one vmlinuz file for each installed kernel:

Terminal
ls /boot/vmlinuz-*
output
/boot/vmlinuz-7.0.0-31-generic

Checking Whether a Reboot Is Pending

If the newest installed kernel is newer than the one uname -r reports, the update is waiting for a reboot. On Ubuntu, the kernel update scripts also create the /var/run/reboot-required file, and /var/run/reboot-required.pkgs lists the packages that asked for the restart:

Terminal
cat /var/run/reboot-required
output
*** System restart required ***

If the file does not exist, no reboot notification is currently recorded. Livepatch can remove the notification even when a newer kernel is installed, so compare the installed kernel versions with uname -r as well. When the file is present, Ubuntu also prints the same message in the login banner when you connect over SSH.

Conclusion

The fastest option is uname -r, while hostnamectl adds the distro name and /proc/version gives the full build details. If rebooting after every kernel update is hard to schedule, our guide on automatic kernel updates explains how live patching applies fixes to the running kernel.

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 1000+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page