A newly installed kernel image can show up in `dpkg-query` even though the system is still running its previous kernel. I wanted a clear way to tell the active release from a package waiting on disk.
`uname -r` reports the kernel running now, so its output answers a different question from the package list. The release makes more sense once you know what part of Linux it describes.
What the Linux kernel version tells you
On this system, uname -r returned 6.17.0-1020-oracle, the release of the Linux kernel running now.
The distribution release and kernel release identify different layers. Ubuntu 24.04.5 LTS names the operating system, and the Ubuntu version check finds that distribution value.
| Value | What it identifies | Command or source |
|---|---|---|
| Kernel release | The active Linux kernel release | uname -r |
| Kernel build version | Build information for the active kernel | uname -v |
| Distribution release | The Linux distribution and its release | cat /etc/os-release |
| Installed kernel packages | Kernel images available in the package database | dpkg-query on Debian and Ubuntu |
What you need before checking
These checks read kernel information, so a regular terminal account is enough. You do not need to install a package or run the commands with sudo.
- Open a terminal in the Linux system you want to inspect.
- Run the command on that system, rather than inside a container or remote shell if your question concerns the host kernel.
A container can report the host kernel because containers share the host kernel. For a VM, the command reports the kernel running inside that VM.
How to find the running kernel version
The uname command is the direct answer for the kernel release. I ran it alongside sysctl and got the same release string from both interfaces.
1. Print the kernel release with uname
Use the release option when you need the identifier to report or compare with documentation. The command’s output changes with the running kernel.
uname -r

The older screenshot is an example, while your output reflects the kernel booted on your system. I use uname -r when I need the short identifier without build details.

2. Read the kernel build details
Use uname -v for the kernel’s build-version string. It includes build information, so it is longer than the release printed by uname -r.
uname -v
The distinction comes from the options documented by GNU’s uname manual: -r selects the kernel release, while -v selects the kernel version string. For bug reports, include the field the project’s instructions ask for.
3. Read /proc/version
The /proc/version file identifies the running kernel and combines its release with build details. I compared its release text with the uname result, and the identifier matched.
cat /proc/version
The release follows Linux version in the output, and the proc_version manual identifies this file as a string for the kernel currently running.

4. Query the release with sysctl
The kernel exposes its release through the kernel.osrelease setting, which sysctl can read without changing it.
sysctl -n kernel.osrelease
My output matched uname -r, with -n removing the setting name.
5. Find the kernel line with hostnamectl
On a system with systemd, hostnamectl reports a Kernel line alongside operating-system details. The retained screenshot shows that line beside the distribution name.
hostnamectl

The command comes from systemd, so a minimal system without systemd may not have it. For a command that works across Linux distributions, use uname -r.
The running kernel and installed kernels are different
uname -r reports the kernel active now. A package query reports kernel images installed on disk, which can include a newer release waiting for the next boot or an older release kept for recovery.
dpkg-query -W 'linux-image*'

The package list answers a different question, so I kept it separate from the running-release check. The Ubuntu installed-package guide covers related package-list commands.
| Question | Use |
|---|---|
| Which kernel is active? | uname -r |
| Which kernel images are installed? | dpkg-query -W ‘linux-image*’ on Debian or Ubuntu |
| Which Ubuntu release is installed? | cat /etc/os-release or the Ubuntu version guide |
After installing a kernel package, the active value remains unchanged until the machine boots into that kernel. Use the site’s Linux restart guide only when a restart is appropriate for your system and workload.
When the reported version does not match expectations
Compare the command with the system you meant to inspect. A container may expose the host’s kernel, while a virtual machine reports its guest kernel.
- If uname -r shows an older release after an installation, check whether the system has booted into the new kernel.
- If a command reports a distribution name or release, use uname -r for the kernel release instead.
- If you need the command’s documented options, open the Linux manual-page guide and read the uname manual.
Check the active release before comparing
For a support request or compatibility check, start with the value the system is running, then compare that exact release with the relevant project’s requirements.
uname -r
Linux kernel version questions
These distinctions answer the related searches that can otherwise lead to a package listing or distribution label instead of the active kernel.
Which command displays the Linux kernel version?
Run uname -r to print the release of the Linux kernel currently running.
How do I check the kernel version on Ubuntu?
Open a terminal and run uname -r. The result is the active kernel release, while /etc/os-release identifies the Ubuntu release.
Does dpkg show the running Linux kernel?
No. A dpkg query lists installed kernel image packages. Run uname -r to identify the kernel active now.
What is the difference between uname -r and uname -v?
uname -r prints the kernel release identifier. uname -v prints the kernel build-version string, which includes build details.
