How to check the kernel version in Linux (running vs installed)
Run uname -r. It prints the release of the kernel that is running right now, for example 6.8.0-149-generic.
That isn't always the newest kernel on the disk. Updates install a new kernel next to the old one, and the server keeps running the old one until it reboots. Compare uname -r with the newest installed kernel. If they differ, the fixes in the new kernel aren't active yet.
Which command shows the Linux kernel version?
Every command below reads the kernel that is running now. They differ in how much detail they print.
| Command | What it prints | Works on |
|---|---|---|
uname -r | The kernel release only, such as 6.8.0-149-generic. Use it in scripts. | Every Linux system |
uname -a | Kernel name, hostname, release, build string, architecture and OS name on one line | Every Linux system |
uname -v | The build string: build number, options and the date the kernel was compiled | Every Linux system |
cat /proc/version | Release, the compiler that built it, and the build string | Every Linux system |
cat /proc/version_signature | Ubuntu's full package version plus the upstream version it's based on | Ubuntu only |
hostnamectl | The kernel next to the distribution name, boot ID and virtualization type | systemd distributions |
Here is what they print on an Ubuntu 24.04 server:
$ uname -r
6.8.0-149-generic
$ uname -a
Linux web-01 6.8.0-149-generic #149-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 23 13:21:10 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/version_signature
Ubuntu 6.8.0-149.149-generic 6.8.12
$ hostnamectl | grep -E 'Operating System|Kernel'
Operating System: Ubuntu 24.04.5 LTS
Kernel: Linux 6.8.0-149-generic
The date in uname -a and uname -v trips people up. It's the date Ubuntu compiled this kernel, not the date you installed it or booted it.
Why “installed” doesn't mean “patched”
Installing a kernel package never changes the kernel that is running. The update adds a new kernel next to the old one. The bootloader normally picks the new one at the next boot. Until then, the old kernel stays in memory, with all its bugs.
That gap is easy to miss. On Ubuntu, unattended-upgrades installs kernel security updates on its own, but it never reboots by default. A check that reads only the installed package versions will call the server fixed while the vulnerable kernel is still running. The kernel that matters is the one uname -r reports.
So checking the kernel version is really two checks:
- Which kernel is running? (
uname -r) - Which is the newest kernel installed on disk? (next section)
If the answers match, the server runs the newest kernel it has. If they don't, it needs a reboot.
How do I list the installed kernels?
Ubuntu and Debian
$ dpkg -l 'linux-image*' | grep ^ii
ii linux-image-6.8.0-149-generic 6.8.0-149.149 amd64 Signed kernel image generic
ii linux-image-6.8.0-31-generic 6.8.0-31.31 amd64 Signed kernel image generic
ii linux-image-generic 6.8.0-149.149 amd64 Generic Linux kernel image
$ linux-version list
6.8.0-149-generic
6.8.0-31-generic
$ ls -l /boot/vmlinuz*
lrwxrwxrwx 1 root root 25 Nov 14 12:31 /boot/vmlinuz -> vmlinuz-6.8.0-149-generic
-rw------- 1 root root 15108488 Oct 23 12:13 /boot/vmlinuz-6.8.0-149-generic
-rw------- 1 root root 14928264 Apr 19 2024 /boot/vmlinuz-6.8.0-31-generic
lrwxrwxrwx 1 root root 24 Apr 26 2024 /boot/vmlinuz.old -> vmlinuz-6.8.0-31-generic
This server has two kernels. linux-image-generic isn't a third one. It's the metapackage that pulls in each new kernel when Ubuntu publishes it (our guide to updating the kernel on Ubuntu explains how). linux-version comes from the linux-base package, which every Ubuntu and Debian kernel package depends on. On this server, /boot/vmlinuz points at the newest kernel and /boot/vmlinuz.old at the one before it. Debian keeps the same two links in / instead of /boot.
Don't sort kernel versions as plain text. In the listing above, 6.8.0-149 comes before 6.8.0-31, so ls /boot/vmlinuz-* | tail -n 1 picks the older kernel. Use linux-version sort or sort -V.
RHEL, AlmaLinux and Rocky Linux
$ uname -r
5.14.0-570.12.1.el9_6.x86_64
$ rpm -q kernel
package kernel is not installed
$ rpm -q --last kernel-core
kernel-core-5.14.0-687.66.2.el9_8.x86_64 Sat Nov 14 17:57:14 2026
kernel-core-5.14.0-570.12.1.el9_6.x86_64 Thu May 22 11:47:52 2025
$ sudo grubby --default-kernel
/boot/vmlinuz-5.14.0-687.66.2.el9_8.x86_64
That's our AlmaLinux test server right after a dnf upgrade took it from 9.6 to 9.8. The new kernel is installed and set to boot next, but the old one is still running. Two things to notice:
rpm -q kernelcan come back empty. The RHEL 9 family splits the kernel into several packages, and this image, built by a hosting provider, haskernel-corewithout thekernelpackage. Ask forkernel-coreinstead.rpm -q --lastsorts by install time, newest first, andgrubby --default-kernelnames the kernel that will boot next.
dnf keeps up to three kernels by default (the installonly_limit setting in /etc/dnf/dnf.conf). When a new one would go over the limit, it removes an older one, but never the running kernel.
Is the running kernel the newest one installed?
This short script compares the two on Ubuntu and Debian. It's read-only and needs no root:
running=$(uname -r)
newest=$(linux-version list | linux-version sort | tail -n 1)
echo "running: $running"
echo "newest: $newest"
if [ "$running" = "$newest" ]; then echo "OK: the newest installed kernel is running"; else echo "REBOOT NEEDED: $newest is installed but not running"; fi
running: 6.8.0-149-generic
newest: 6.8.0-149-generic
OK: the newest installed kernel is running
On the RHEL family, compare the running kernel with the one GRUB will boot next:
$ [ "$(sudo grubby --default-kernel)" = "/boot/vmlinuz-$(uname -r)" ] && echo "running the default kernel" || echo "a different kernel boots next: reboot needed"
a different kernel boots next: reboot needed
That was the AlmaLinux server above, before its reboot. After the reboot, the same line printed running the default kernel.
The case uname -r can't see
On Ubuntu, the package version has two numbers after the dash: the ABI number and the upload number (6.8.0-149.149). An update can raise the upload number and keep the ABI. Then the package name stays the same, the files are replaced in place, and uname -r looks the same before and after. /proc/version_signature shows the full version of the kernel in memory, so compare it with the installed package:
$ cat /proc/version_signature
Ubuntu 6.8.0-149.149-generic 6.8.12
$ dpkg-query -W -f='${Version}\n' "linux-image-$(uname -r)"
6.8.0-149.149
Both say 6.8.0-149.149, so this server runs exactly the kernel it has installed. The last field, 6.8.12, is the upstream stable release the Ubuntu kernel was built from.
What do the parts of the version number mean?
Take 6.8.0-149-generic on Ubuntu:
6.8is the upstream kernel series it's based on. The.0is a placeholder.149is Ubuntu's ABI number. Each new ABI is a separate package, such aslinux-image-6.8.0-149-generic, so it installs next to the old kernel.genericis the flavour. Cloud images often run a cloud flavour, such asaws,azureorgcp.
Debian follows the same pattern with different names. Its uname -r shows the series, the ABI number and the flavour, and the exact package version is at the end of uname -v. From our Debian 12 test server:
$ uname -r
6.1.0-54-amd64
$ uname -v
#1 SMP PREEMPT_DYNAMIC Debian 6.1.190-1 (2026-10-16)
Here 6.1.190-1 is the version of the linux-image-6.1.0-54-amd64 package, built from upstream 6.1.190.
kernel.org puts it simply: if you didn't build your kernel from kernel.org yourself, you run a distribution kernel, and the text after the dash marks it. Distribution kernels keep their base version for years. Ubuntu 24.04's default kernel stays on 6.8 until its support ends in May 2029, and fixes are backported into it. Don't judge a server by comparing its version with the newest release on kernel.org. Compare it with the newest kernel package from your distribution. Our guide to checking for security updates on Ubuntu shows how to see what's pending.
How do I know if the server needs a reboot?
Ubuntu and Debian: the reboot-required flag
When a package that needs a reboot is installed, a hook creates /var/run/reboot-required and adds the package name to /var/run/reboot-required.pkgs:
$ cat /var/run/reboot-required.pkgs 2>/dev/null || echo "no reboot needed"
no reboot needed
Ubuntu writes the flag from hooks in update-notifier-common and unattended-upgrades. On Debian, the hook comes with unattended-upgrades; without that package, nothing creates the file. /var/run is a link to /run, which lives in memory, so the flag disappears at the next boot.
One exception on Ubuntu: when Livepatch is enabled, the hooks skip the flag for kernel packages. Run canonical-livepatch status instead to see whether Livepatch wants a kernel upgrade.
RHEL, AlmaLinux and Rocky Linux
$ sudo dnf needs-restarting -r; echo "exit=$?"
Core libraries or services have been updated since boot-up:
* dbus-broker
* glibc
* linux-firmware
* microcode_ctl
* systemd
Reboot is required to fully utilize these updates.
More information: https://access.redhat.com/solutions/27943
exit=1
Exit code 1 means a reboot is needed and 0 means it isn't, so scripts can test it. The plugin comes with dnf-plugins-core and checks a fixed list of package names updated since the last boot.
Look at what's missing from that list: the new kernel. The version on our AlmaLinux 9 server (python3-dnf-plugins-core-4.3.0-26.el9) looks for a package named kernel, and this server only has kernel-core. Upstream dnf-plugins-core added kernel-core to that list in 2023, but this package doesn't include the change. It asked for a reboot only because glibc, systemd and other core packages changed in the same upgrade. After a kernel-only update it could stay silent, so compare uname -r with grubby --default-kernel as well.
The flag is a hint. The comparison is the proof. The flag file exists only if a hook wrote it, and anyone can delete it. The uname -r comparison checks the kernel itself. Use both, and plan the reboot with our Linux reboot command guide.
Which kernel did the server boot last time?
last records each boot along with the kernel it ran. Use -x for system entries and -w so the kernel name isn't cut off at 16 characters:
$ last -x -w reboot
reboot system boot 6.8.0-149-generic Sat Nov 14 12:33 still running
reboot system boot 6.8.0-31-generic Sat Nov 14 12:20 - 12:33 (00:12)
This is the real boot history of the Ubuntu 24.04 server we used for this page, from when it was set up; we didn't reboot it for this guide. It first booted on 6.8.0-31, the kernel Ubuntu 24.04 shipped with in April 2024. An update during that first boot installed 6.8.0-149, but only the reboot at 12:33 put it into service. Until then, the fixed kernel was on disk and the old one was running.
If the journal is kept on disk (by default it is when the /var/log/journal directory exists, as on this server), journalctl --list-boots gives the same timeline with a boot ID for each boot:
$ journalctl --list-boots --no-pager | tail -n 2
-1 11111111222243338444555555555555 Sat 2026-11-14 12:20:57 UTC Sat 2026-11-14 12:33:43 UTC
0 66666666777748889999aaaaaaaaaaaa Sat 2026-11-14 12:33:53 UTC Sat 2026-11-14 16:48:38 UTC
Debian 13 no longer ships last, because the old login record files break in 2038. Its replacement is in the wtmpdb package, and journalctl --list-boots works there too.
Check the kernel on several servers at once
For a handful of Ubuntu or Debian servers, one SSH loop prints the running and newest kernel side by side:
for h in web-01 web-02 db-01; do
ssh "$h" 'echo "$(hostname) running=$(uname -r) newest=$(linux-version list | linux-version sort | tail -n 1)"'
done
web-01 running=6.8.0-149-generic newest=6.8.0-149-generic
Any line where the two values differ is a server that has its kernel fix on disk but not in memory. Plan a reboot for it, then run the loop again to confirm.
How we checked this: On 14 Nov 2026 (UTC): an Ubuntu 24.04.5 LTS production server (kernel 6.8.0-149-generic, systemd 255, apt 2.8.4) with read-only commands only, where the boot history shown is from when the server was set up; a Debian 12.15 test server (kernel 6.1.0-54-amd64); and an AlmaLinux test server that a dnf upgrade took from 9.6 to 9.8, checked before and after its reboot from kernel 5.14.0-570.12.1.el9_6 to 5.14.0-687.66.2.el9_8, plus a read-only look at its needs-restarting plugin. Hostnames and boot IDs in the output are replaced. Anything we didn't run ourselves comes from the official documentation listed under Sources.
Check which CVEs are really open on your server
HostCrust Patch Proof compares every installed package with your distribution's own security data. It counts fixes your distro backported and checks the kernel that is actually running, not just the one on disk. Read-only, no root, free.
FAQ
What is the kernel version shown by uname?
uname -r shows the kernel release, such as 6.8.0-149-generic. That's the value people usually mean by “kernel version”. uname -v shows the kernel's build string, such as #149-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 23 13:21:10 UTC 2026. The date in it is when the kernel was compiled, not when it was installed or booted. Plain uname prints only Linux.
How do I check the Linux distribution version instead of the kernel?
Run cat /etc/os-release and look at PRETTY_NAME, for example Ubuntu 24.04.5 LTS. It works on Ubuntu, Debian, RHEL, AlmaLinux and Rocky Linux. hostnamectl shows the same name on its “Operating System” line. The distribution version tells you how long you get security updates; see our end-of-life dates guide.
Is kernel 6.12 an LTS kernel?
Yes. kernel.org lists 6.12 as a longterm kernel with a projected end of life in December 2028, next to 6.18, 6.6, 6.1, 5.15 and 5.10. Your distribution's kernel follows its own schedule, though. Ubuntu 24.04's default kernel is based on 6.8, which isn't on kernel.org's longterm list, and Canonical supports it until May 2029.
Is Linux kernel 7.0 out yet?
Yes. In mid-November 2026, kernel.org lists 7.3 as the latest stable kernel and 7.4 as a release candidate. Ubuntu 26.04 LTS ships a 7.0-based kernel, and Ubuntu 24.04's optional HWE kernel moved to 7.0 in July 2026.
Does a higher kernel number mean the server is more secure?
No. Distributions keep the same base version for the life of a release and backport security fixes into it. A fully patched Ubuntu 24.04 server still reports a 6.8 kernel. What matters is whether you run the newest kernel package your distribution has published, and whether that kernel is the one running.
Sources
- uname(1) manual page, Ubuntu 24.04
- proc_version(5): /proc/version identifies the running kernel
- Ubuntu kernels: reading /proc/version_signature
- kernel.org: active kernel releases and longterm kernels
- Ubuntu kernel lifecycle and enablement stack
- last(1) manual page, Ubuntu 24.04
- unattended-upgrades upstream: the kernel hook that writes /var/run/reboot-required
- DNF needs-restarting plugin (-r, --reboothint)
- dnf-plugins-core source: the packages that make needs-restarting ask for a reboot
- dnf-plugins-core commit baad35c: add kernel-core to the needs-restarting reboot list
- DNF configuration reference: installonly_limit
- Rocky Linux documentation: the Linux kernel lab (rpm -q kernel, grubby --default-kernel)
- Debian 13 release notes: last, lastb and lastlog have been replaced