How to Check Linux Kernel Version?

Every Linux system administrator, developer, and even curious everyday user will eventually need to know exactly which kernel version their machine is running. The kernel is the core of the operating system — it manages hardware resources, memory, processes, and system calls. Knowing the kernel version matters when applying security patches, checking driver compatibility, verifying whether a specific feature or bug fix is present, or simply filing an accurate bug report. Fortunately, Linux provides several fast and reliable ways to retrieve this information from the terminal.

Linux Kernel Version

Understanding the Kernel Version String

Before running any command, understanding what the output actually means saves confusion later. A typical kernel version string looks like this:

6.8.0-49-generic

Each segment carries specific information. The first number — 6 — is the major version, indicating a significant milestone in kernel architecture and feature development. The second number — 8 — is the major release, marking substantial new features introduced to the kernel. The third number — 0 — is the minor revision, representing smaller updates, bug fixes, and stability improvements. Everything after the hyphen — 49-generic — is distribution-specific information added by the Linux distro maintainer, indicating the package revision and build type.

Method 1: uname -r — The Fastest Command

The uname command stands for Unix Name and is the standard tool for displaying system information on any Linux system. The -r flag prints only the kernel release string — nothing else.

Open a terminal and run:

bash

uname -r

Output example:

6.8.0-49-generic

Clean, direct, and works on every Linux distribution without exception — Ubuntu, Fedora, Debian, CentOS, Arch, RHEL, and any others. No packages to install, no root privileges required.

Method 2: uname -a — Full System Information

For a broader snapshot that includes more than just the kernel version, the -a flag prints all available system information at once:

bash

uname -a

Output example:

Linux hostname 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov  6 17:36:22 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Reading from left to right: the kernel name (Linux), the system hostname, the kernel release version, the kernel version build string with timestamp, the machine hardware architecture (x86_64 for 64-bit), and the operating system (GNU/Linux). This single command surfaces most of what’s needed for system documentation or support tickets.

Method 3: hostnamectl — OS and Kernel Together

On modern Linux distributions running systemd — which includes Ubuntu 16.04 and all later versions, Fedora, Debian 8+, CentOS 7+, and most current distros — hostnamectl provides a clean, labelled system summary:

bash

hostnamectl

The output includes clearly labelled fields:

Static hostname: myserver

Operating System: Ubuntu 22.04.5 LTS

Kernel: Linux 6.8.0-49-generic

Architecture: x86-64

The Kernel line displays the version directly alongside the OS name — especially useful when you need both the distribution version and kernel version simultaneously for compatibility verification. This command requires no flags and presents information in the most human-readable format of any built-in method.

Method 4: cat /proc/version — Full Build Detail

The /proc/version file is a virtual file maintained by the kernel itself, containing the version string along with compiler details and build timestamp:

bash

cat /proc/version

Output example:

Linux version 6.8.0-49-generic (buildd@lcy02-amd64-059) (gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:36:22 UTC 2024

This output is the most detailed of all methods — it shows which compiler built the kernel, the build date and time, and the full version identifier. Useful when verifying that a specific security patch or build is genuinely present on the system, rather than just seeing the version number.

Method 5: dmesg | grep “Linux version”

The dmesg command reads the kernel ring buffer — the log of messages generated by the kernel during and after boot. Filtering it for the version string retrieves the same detailed information as /proc/version but from the boot log:

bash

dmesg | grep “Linux version”

This method is particularly useful on systems where /proc/version is restricted or on custom minimal installations where certain virtual filesystem entries behave differently.

Method 6: dpkg — Listing Installed Kernel Packages

On Debian-based systems including Ubuntu, the dpkg package manager can list all installed kernel image packages:

bash

dpkg –list | grep linux-image

The output lists all kernel versions currently installed on the system — both the active kernel and any older kernels retained for fallback booting. Lines beginning with ii indicate currently installed packages. This is especially useful when planning kernel updates or removals.

Checking Kernel Version Without a Terminal

On Ubuntu Desktop, a graphical path exists for users who prefer not to use the command line. Open Settings → About. The system information panel displays the OS version. For the kernel specifically, open the System Monitor application (searchable from the applications menu) and check the system tab for detailed hardware and kernel information.

FAQs

Q: Which command is the quickest to check the Linux kernel version?

A: uname -r — single command, instant output, works on every Linux distribution without any prior setup.

Q: What does “generic” mean at the end of the kernel version string?

A: “Generic” is a Ubuntu-specific build designation indicating a standard kernel built for general desktop and server use, as opposed to specialised variants like lowlatency or cloud-optimised builds.

Q: Can I check the kernel version on a remote server without logging in?

A: No. All these methods require terminal access to the system. For a remote machine, SSH access is needed first.

Q: Do all Linux distributions use the same kernel version format?

A: The major.minor.patch format (like 6.8.0) is universal. The suffix after the hyphen varies by distribution — Ubuntu appends build numbers and type labels, Fedora uses different conventions, and Arch Linux uses a minimal suffix.

Q: How do I check if multiple kernel versions are installed on my system?

A: Run dpkg –list | grep linux-image on Debian/Ubuntu systems to see all installed kernel packages. On RPM-based systems like Fedora or CentOS, use rpm -qa | grep kernel.

Leave a Reply

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