Skip to content
Log In Sign Up info@muvcloud.com

The Running Kernel

uname -r

The output is one line: the kernel version, a build number, and a suffix chosen by the distribution. Ubuntu kernels end in -generic or a similar flavor name, and AlmaLinux and Rocky Linux kernels contain el followed by the major release, such as el9 (often with the minor release added, as in el9_6), and the architecture. No sudo is needed. The commands in this guide work on Ubuntu, Debian, AlmaLinux, and Rocky Linux.

More Detail with uname

CommandShows
uname -rKernel release
uname -vBuild number and date
uname -mArchitecture, such as x86_64
uname -nHost name
uname -aAll of the above

Other Places That Show It

cat /proc/version
hostnamectl

/proc/version is provided by the running kernel and also names the compiler it was built with. hostnamectl shows the kernel on its Kernel line, next to the operating system and the virtualization type, which makes it a good one-screen summary.

How to Read the Version

  • Major and minor: the first two numbers, such as 6.8, name the upstream kernel series.
  • Patch level: the third number is the upstream stable update. Ubuntu and the RHEL family often keep it at 0 and count their own updates after the dash.
  • Distribution build: everything after the dash is the distribution's own build. Distributions add security fixes from newer kernels, so a lower upstream number does not mean an unpatched kernel.

The Kernel Is Not the Distribution Version

The kernel is one package of the system. The distribution release, such as Ubuntu 24.04 or AlmaLinux 9, is shown elsewhere; see how to check your Ubuntu version and how to check the RHEL or Rocky Linux version. The same release can run different kernels over its life.

List Installed Kernels

On Debian and Ubuntu:

dpkg --list | grep linux-image

Lines that start with ii are installed. On AlmaLinux and Rocky Linux:

rpm -q kernel

Several versions are normal: package managers keep older kernels so you can boot one of them if a new kernel fails. The files themselves are in /boot, as vmlinuz- followed by the version.

Running vs Installed After an Update

A kernel update installs a new kernel next to the running one; the running kernel does not change until the server restarts. If uname -r shows an older version than the newest one in the list, a reboot is pending. To check whether the system wants one:

cat /var/run/reboot-required
sudo dnf needs-restarting -r

The first works on Debian and Ubuntu, where the file only exists when a reboot is needed. The second works on AlmaLinux and Rocky Linux and comes from the dnf-plugins-core package; it reports whether a reboot is required and exits with 1 if so. Plan the restart as described in how to reboot a Linux server, then run uname -r again to confirm the new kernel is running.

Old Kernels and Disk Space

On Debian and Ubuntu, sudo apt autoremove removes kernels that are no longer needed, while keeping the running one and a fallback. On AlmaLinux and Rocky Linux, dnf keeps a limited number of kernels on its own, three unless installonly_limit in /etc/dnf/dnf.conf says otherwise. Do not delete files in /boot by hand. If /boot is a small separate partition that fills up, check it with df first.

Kernel on a Cloud Server

On a KVM cloud server, the kernel inside your server is your own and is updated with the normal package updates, so these commands show the real kernel you run. On container-based virtualization, the kernel belongs to the host instead; what is KVM virtualization explains the difference.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations