sodcalculator

10 Tech How-To

Check Linux Kernel Version & Find Security Updates

Guide 10-60000 · Updated · Step by step

This guide shows you how to identify the exact Linux kernel version running on your system and then find which security updates apply to it. You’ll use simple terminal commands to get the version, and then check your distribution’s update repositories to see available patches. No special tools are required—just a terminal and an internet connection.

What You’ll Need

  • A Linux system (any distribution) with terminal access.
  • An internet connection to query update repositories.
  • Basic familiarity with running commands in a terminal.

Step-by-Step

  1. Open a terminal. On most systems, you can press Ctrl+Alt+T or search for “Terminal” in your applications menu.
  2. Check the kernel version with uname. Run the following command to display your current kernel release:
  3. uname -r

    This outputs something like 5.15.0-91-generic (Ubuntu) or 6.6.15-arch1-1 (Arch). The first three numbers (e.g., 5.15.0) are the main version; the rest are distribution-specific patches.

  4. Get more detailed kernel info (optional). Run uname -a to see the full kernel string including the build date and architecture. This is helpful when comparing with security advisories.
  5. Identify your distribution and package manager. Different distros use different tools. Run one of these to see what you’re on:
  6. cat /etc/os-release

    This shows the distro name and version. From here, use the appropriate command below.

  7. For Debian/Ubuntu: Update the package list and check for available kernel updates:
  8. sudo apt update
    apt list --upgradable | grep linux

    The output lists packages like linux-image-generic or linux-image-5.15.0-91-generic if a newer kernel is available.

  9. For Fedora/RHEL/CentOS: Use dnf (or yum on older systems):
  10. sudo dnf check-update kernel

    If updates exist, you’ll see the new kernel package version listed.

  11. For Arch Linux: Use pacman:
  12. sudo pacman -Sy
    pacman -Qu | grep linux

    This lists all packages with available updates, filtered for kernel-related ones.

  13. Check for security-specific advisories. Visit your distribution’s security tracker website (e.g., Ubuntu CVE tracker, Red Hat CVE database) and search for your kernel version. Alternatively, use the ubuntu-security-status tool on Ubuntu:
  14. ubuntu-security-status

    This shows a summary of packages with known security issues, including the kernel.

  15. Apply the updates (if any). Once you’ve confirmed a newer kernel is available, install it with your package manager (e.g., sudo apt upgrade, sudo dnf update kernel, sudo pacman -S linux). Reboot to load the new kernel.

Common Mistakes

  • Confusing kernel version with distribution version. uname -r gives the kernel, not the OS release. They are different.
  • Assuming the latest kernel is always best. Distributions often backport security fixes to older kernels rather than upgrading to the newest. Your distro’s repositories may not have the latest upstream kernel, and that’s fine.
  • Not updating the package list first. If you skip apt update or dnf check-update, you might see outdated information and miss available patches.
  • Ignoring the architecture. A 64-bit kernel update won’t apply to a 32-bit system. Check with uname -m.
  • Forgetting to reboot. Installing a new kernel doesn’t activate it until you restart. Verify with uname -r after reboot.

Tips

  • Keep a record of your current kernel. Before updating, note the version so you can roll back if needed (most distros keep the previous kernel in the boot menu).
  • Use modinfo to check kernel module versions. If you’re troubleshooting a specific driver, modinfo <module_name> shows its version and dependencies.
  • Check your distro’s security mailing list. Many distros announce kernel security updates via email or RSS. Subscribing keeps you informed without manually checking.
  • For enterprise systems, consider using yum --security or dnf --security. These commands filter updates to only those that address security issues, which is useful on servers where stability is critical.
  • Automate with a cron job. You can schedule a weekly check to email you when kernel updates are available. For example, a simple script using apt or dnf can do this.

Troubleshooting

  • Command not found. If uname isn’t found, your PATH is broken. This is rare; try /bin/uname -r or log in as another user.
  • Permission denied. Updating packages requires root. Use sudo or switch to root with su.
  • No internet access. If update commands fail with network errors, check your connection. You can still see the current kernel version, but you won’t be able to fetch updates until connectivity is restored.
  • Package manager errors. If apt or dnf complains about broken packages or locks, wait a few minutes (another process may be running) or run sudo apt --fix-broken install (Debian/Ubuntu) or sudo dnf clean all (Fedora).
  • Kernel version doesn’t match what you expected. If you just updated but uname -r still shows the old version, you haven’t rebooted. Do so and check again.
  • Security tracker shows many CVEs. Don’t panic. Not all CVEs affect your configuration. Focus on those marked as “needs triage” or “released” for your kernel version and architecture.

Frequently Asked Questions

How often should I check for kernel security updates?

At least once a week for desktop systems, and daily for production servers. Many distros offer automatic security updates—enable them if possible.

Can I skip kernel updates if I don’t want to reboot?

You can, but it leaves your system vulnerable to known exploits. If rebooting is a problem, consider using live patching tools like Canonical Livepatch or Ksplice, which apply patches without a reboot.

What does the kernel version number mean?

The format is major.minor.patch. Major changes are rare, minor versions add features, and patch versions fix bugs and security issues. Distribution suffixes (like -generic) indicate specific builds.

Is the latest kernel always the most secure?

Not necessarily. Distributions often backport security fixes to older, stable kernels to avoid introducing regressions. The latest upstream kernel may have new features but also new bugs. Stick with your distro’s recommended kernel.

How do I know if a specific CVE affects my kernel?

Check the CVE description against your kernel version and configuration. Tools like ubuntu-security-status or dnf updateinfo --cve (on Fedora) can list relevant CVEs. You can also use online databases like the Ubuntu CVE tracker.

What if my distribution is no longer supported?

If your distro has reached end-of-life, you won’t receive security updates. The only safe options are to upgrade to a supported release or migrate to a different distribution.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →