Kahibaro
Discord Login Register

4.3.5 Kernel versioning and updates

Understanding Linux Kernel Version Numbers

Linux kernel versions follow a structured scheme that encodes stability, patch level, and sometimes distribution-specific information.

A modern kernel version string often looks like:

Let’s break these apart.

Mainline version triplet: X.Y.Z

The mainline kernel version is:

$$X.Y.Z$$

In plain terms:

Distribution-specific suffixes

Distributions add their own suffixes to the upstream version:

Key point: the first three numbers indicate compatibility with upstream; the rest describe packaging, patches, and build details specific to the distribution.

Long-Term Support (LTS) vs non-LTS kernels

Not all kernel branches are maintained equally long.

The current and historical LTS kernels are listed on:

Your distribution may further extend support for a chosen kernel version (e.g. RHEL backporting many years of fixes to 5.14), so the effective support lifetime can be even longer than upstream LTS.

Checking Your Current Kernel Version

You often need to know:

Basic version check

Use:

bash
uname -r

This prints the running kernel release (including distribution suffix).

To see full information:

bash
uname -a

This includes:

Listing all installed kernels (distribution-specific)

Different distributions manage kernel packages differently. Commands below are read-only inspections; they don’t change anything.

Debian / Ubuntu and derivatives

bash
dpkg --list | grep -E 'linux-image|linux-headers'

You’ll see lines like:

text
ii  linux-image-5.15.0-94-generic  ...
ii  linux-image-6.8.0-36-generic   ...

The one from uname -r is the currently running kernel. Others are installed but unused until you boot them.

Fedora / RHEL / CentOS / Alma / Rocky

bash
rpm -qa | grep '^kernel'

Example entries:

text
kernel-5.14.0-503.el9.x86_64
kernel-5.14.0-427.el9.x86_64

The kernel-core / kernel-modules packages follow similar names.

Arch Linux / Manjaro (pacman-based)

bash
pacman -Qs '^linux[0-9]*'

Or for installed packages:

bash
pacman -Q | grep '^linux'

You may see:

text
linux 6.6.10.arch1-1
linux-lts 6.1.78-1

Again, the one from uname -r is the running kernel; others may be installed as alternates.

Sources of Kernel Updates

Where updates come from depends on how you maintain your system.

1. Distribution-managed kernel (most common)

This is the normal and recommended approach:

Different distributions use different update policies:

2. Vendor / hardware-specific kernels

Some vendors maintain their own kernel packages with custom patches, e.g.:

These are also usually delivered as packages but from specific repositories or images.

3. Mainline or self-compiled kernels

If you need very new features or particular patch sets, you may:

Using these shifts more responsibility to you for:

Updating the Kernel via Package Manager

The precise commands differ by distribution, but the concepts are similar:

Debian / Ubuntu and derivatives

Updating the kernel is usually part of a system-wide upgrade:

bash
sudo apt update
sudo apt full-upgrade

Notes:

To explicitly see which kernel image packages are available:

bash
apt list --upgradable | grep linux-image

Reboot after the update to start using the new kernel:

bash
sudo reboot

Fedora / RHEL / CentOS / Alma / Rocky

Use:

bash
sudo dnf upgrade

On RHEL-like systems:

To see the currently installed kernel packages:

bash
rpm -qa | grep '^kernel'

Reboot to use the new version:

bash
sudo reboot

Arch Linux / Manjaro (pacman-based)

On Arch:

bash
sudo pacman -Syu

This:

On Manjaro, similar commands (or GUI tools) are used, but kernel management can also be done via mhwd-kernel.

Reboot afterward:

bash
sudo reboot

openSUSE (zypper)

bash
sudo zypper refresh
sudo zypper update

or to be explicit:

bash
sudo zypper update kernel-default

Again, reboot to take effect.

Multiple Kernels and Bootloader Selection

Running multiple kernels in parallel is common and often desirable for safety.

Why keep older kernels?

Reasons to keep at least one older kernel:

Keeping an old kernel gives you a quick rollback:

Choosing a kernel at boot (GRUB example)

If your distribution uses GRUB2:

  1. On reboot, at the GRUB menu:
    • Press Esc or Shift (depending on distro/firmware) if the menu is hidden.
  2. Select “Advanced options for …”.
  3. Choose the entry with the kernel version you want to boot.

The exact menu wording varies by distribution, but “Advanced options” or “Previous Linux versions” is typical.

Listing available boot entries

You can inspect GRUB’s generated config:

bash
grep -E "menuentry 'Advanced" -n /boot/grub*/grub.cfg
grep -E "menuentry '.*Linux" -n /boot/grub*/grub.cfg

Don’t edit these autogenerated files manually; use distribution tools to change the default kernel.

Kernel Update Strategies

How aggressively you update your kernel depends on your environment.

Desktop / personal systems

Typical strategies:

Servers / production systems

More conservative strategies:

Real-time and specialized kernels

Some workloads (low-latency, telecom, certain industrial control) use:

Update strategy there is often:

Safely Removing Old Kernels

Over time, multiple older kernels can accumulate and use disk space, especially in /boot.

General principles:

Specific commands are distribution-dependent.

Debian / Ubuntu

To see installed image packages:

bash
dpkg --list | grep linux-image

To remove a specific old kernel (example):

bash
sudo apt remove linux-image-5.15.0-94-generic

Or use helper tools (where available):

bash
  sudo purge-old-kernels

Use with caution; always ensure at least one fallback remains.

Fedora / RHEL / CentOS / Alma / Rocky

List kernels:

bash
rpm -qa | grep '^kernel'

Remove a specific old version:

bash
sudo dnf remove kernel-5.14.0-427.el9.x86_64

RHEL-based systems may have a configuration option for installonly_limit in /etc/dnf/dnf.conf or /etc/yum.conf which controls how many old kernels to keep automatically.

Example:

ini
installonly_limit=3

Arch Linux

Arch typically keeps only the current kernel for each kernel package you install (linux, linux-lts, etc.), so kernel accumulation is less of an issue. Removing an entire kernel variant:

bash
sudo pacman -Rns linux-lts

Again, don’t remove the kernel package you are currently running unless you have another installed and configured.

Advanced: Tracking Kernel Updates and Security

For security-conscious environments, you need to know when a kernel needs updating, particularly for:

Common practices:

Many Linux distributions also tag kernel updates clearly as security-related in package changelogs.

Example (Debian/Ubuntu):

bash
apt changelog linux-image-$(uname -r)

This shows what changed between package versions (including security fixes).

When to Consider a Kernel Upgrade vs Full OS Upgrade

You’re sometimes faced with a choice:

Factors:

Summary

Views: 104

Comments

Please login to add a comment.

Don't have an account? Register now!