How to Check Ubuntu Kernel Version: Simple Methods & Best Practices

1. Introduction

Ubuntu is a widely used open-source Linux distribution. One of the key factors that strongly influences system stability, security, and performance is the kernel. The kernel is the core of the OS, acting as the central component that communicates directly between hardware and software, thereby determining the behavior of the entire system. Therefore, for Ubuntu users, verifying the kernel version is important.

In particular, when troubleshooting system issues, implementing security measures, or aiming for performance improvements, checking the kernel version often proves useful. Because security updates are periodically provided for the kernel, it is also recommended to keep track of whether the latest version is applied.

In this guide, we introduce several concrete methods for checking the kernel version on Ubuntu. From terminal-based approaches to graphical user interface (GUI) methods, we cover a wide range of techniques, and also explain basic knowledge and key points regarding kernel versions.

年収訴求

2. What Is the Kernel?

In Ubuntu and other Linux distributions, the kernel functions as the central component of the system. The kernel is the heart of the OS, responsible for exchanging information between hardware and software. Here, we explain the specific roles the kernel plays and highlight its importance.

Roles of the Kernel

The kernel, acting as the bridge between hardware and software, is responsible for the following important functions:

  • Resource Management
    The kernel manages system resources such as CPU, memory, and disk, adjusting usage so that each application can use them appropriately. This enables the system to run smoothly even when multiple processes operate simultaneously.
  • Device Management
    The kernel controls hardware devices like printers, keyboards, mice, network cards, etc., making them usable by applications. It communicates with hardware via device drivers, managing input from users and output from the system.
  • Security and Protection
    The kernel ensures system security by separating user space and kernel space. This prevents ordinary applications from directly accessing hardware, thus maintaining system stability and security.

The Importance of Kernel in Ubuntu

In Linux systems like Ubuntu, updating the kernel not only enhances system stability but also improves security. When kernel vulnerabilities are discovered, the Ubuntu development team promptly publishes updates. For this reason, it is important to regularly check the kernel version and update to the latest one when needed.

Thus, the kernel is a critical component at the heart of the system. In the next section, we will explain in detail how to check the kernel version on Ubuntu.

3. How to Check the Kernel Version

There are several ways to check the kernel version in Ubuntu. Here we introduce easy terminal methods, explaining how to use each command and how to interpret the output.

Check Kernel Version with `uname` Command

The simplest and most commonly used method is to use the uname command. This command retrieves system information and displays various details including the kernel version.

  1. Open your terminal.
  2. Type the following command and press Enter:
   uname -r
  • Option -r is used to display the kernel release version. Sample output:
   5.4.0-66-generic

In the above output, 5.4.0-66-generic is the kernel version. This version format includes the major version, minor version, and patch number.

Check via `/proc/version` File

You can also check the /proc/version file. This file contains the current kernel version and compilation information.

  1. In the terminal, run the following command:
   cat /proc/version

Sample output:

   Linux version 5.4.0-66-generic (buildd@lcy01-amd64-025) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #74-Ubuntu SMP Thu Jan 14 18:28:23 UTC 2021

This output includes not only the kernel version but also information about the compiler version and build timestamp.

Check with `hostnamectl` Command

On Ubuntu versions from 16.04 onward, you can use the hostnamectl command to view system information including the kernel version.

  1. Run the following command in the terminal:
   hostnamectl

Sample output:

   Static hostname: ubuntu
         Icon name: computer-vm
           Chassis: vm
        Machine ID: abcdef1234567890
           Boot ID: 123456abcdef98765
    Operating System: Ubuntu 20.04.1 LTS
              Kernel: Linux 5.4.0-66-generic
        Architecture: x86-64

In this output, the “Kernel:” line shows the kernel version.

Differences and Use Cases for Each Method

  • `uname -r`: Ideal when you just want to quickly see the kernel version.
  • `/proc/version`: Useful when you need more detailed information.
  • `hostnamectl`: Recommended when you want to view overall system information together with kernel details.

The above covers terminal-based methods for checking the kernel version. In the next section, we explain how to verify the kernel using GUI tools.

4. Checking Kernel Version via GUI

Ubuntu also allows you to check the kernel version using a graphical user interface (GUI), without using the command line. GUI methods are easy to use, especially for users not familiar with terminal operations.

Using the System Settings Tool

Ubuntu includes a “Settings” menu where you can view basic system information, including the kernel version. Follow these steps:

  1. Open the Settings menu
  • Click the system menu (gear icon) at the top right of the desktop and select “Settings.”
  1. Open the “About” or “Details” section
  • Within the Settings menu, select “About” or “Details” (the name may vary by version).
  1. View system information
  • The “About” or “Details” section displays the basic system information, including the kernel version. Look for “Kernel” or “Linux version” to find the current kernel version. Example:
   Linux 5.4.0-66-generic

Using GNOME System Monitor

On the GNOME desktop environment, you can also view the kernel version via the “GNOME System Monitor” application.

  1. Launch System Monitor
  • Search for “System Monitor” in the applications menu and open it.
  1. Select the “System” tab
  • When the System Monitor is open, click the “System” tab, which shows system information and running processes.
  1. Verify the kernel version
  • In the “System” tab, you’ll see entries like “OS” or “Kernel,” where the kernel version is displayed.

Advantages of GUI Methods

GUI methods are particularly user-friendly when you want to grasp system details visually or when you are not comfortable with the command line. Since no command input is required, beginners can easily access information from the settings menu or system monitor.

The explanation of GUI methods ends here. Next, we will write about “5. How to Read Kernel Version and the Meaning of Each Part.”

5. How to Read Kernel Version and What Each Part Means

Ubuntu’s kernel version number contains information such as major version, minor version, patch number, etc. In this section, we explain the structure of the version number and help you understand what each part represents.

Structure of the Kernel Version Number

The kernel version is usually expressed in a format like this:

5.4.0-66-generic

Using this example, we explain the meaning of each part in order.

  1. Major Version (5)
  • The major version indicates major changes or new feature additions to the kernel. When this number increases, it usually means significant enhancements or new technologies have been added.
  1. Minor Version (4)
  • The minor version represents smaller improvements or feature additions relative to the major version. When this number increases, it typically includes important bug fixes or performance enhancements.
  1. Patch Number (0)
  • The patch number corresponds to bug fixes or security patches. It does not include major feature additions or changes; rather, it increments when small fixes are applied.
  1. Build Number (66)
  • The build number is specific to the distribution (in this case Ubuntu) versioning.
  1. Suffix (generic)
  • The suffix is a string indicating the kernel’s build configuration or use case. generic is the standard desktop kernel, and there are other kernels such as lowlatency (for low-latency use) depending on the purpose.

Benefits of Understanding Kernel Version

By deeply understanding the kernel version, you can make decisions about system stability and security more easily. It also helps when specific applications require particular kernel versions or when you want to verify that the latest security patches are applied.

In the next section, we will present a correspondence table between kernel versions and Ubuntu release versions, and examine how each version corresponds.

6. Kernel Version vs. Ubuntu Release Version Correspondence Table

In Ubuntu, each release version is associated with a recommended kernel version. Since features and security patch availability differ depending on the kernel version, understanding the correspondence between the release version and kernel version helps with update management and troubleshooting.

Ubuntu Release Versions and Their Corresponding Kernel Versions

Below is a list of major Ubuntu releases and their corresponding kernel versions. The kernel version shipped with each release is selected to ensure stability and long-term support.

Ubuntu ReleaseKernel Version
20.04 LTS5.4
20.105.8
21.045.11
21.105.13
22.04 LTS5.15
22.105.19
23.046.2

Long Term Support (LTS) Versions and Kernel Versions

LTS (Long Term Support) versions (e.g. 20.04, 22.04) receive support for a longer period than regular releases, making them popular for business or server use. In an LTS release, the chosen kernel emphasizes stability over cutting-edge features.

Kernel Updates per Release

In regular releases (e.g. 20.10, 21.04), the latest kernel version is actively adopted, making new features available. However, regular releases generally offer only about 9 months of support, so they favor users seeking new features rather than long-term stability.

Using the Correspondence Table and Checking Kernel Version

By using the table above, you can more easily grasp how kernel versions change with Ubuntu releases. Also, if you intend to update to the latest kernel for security reasons or need a specific kernel feature for software installation, you can verify whether the kernel version you want is supported.

In the next section, we explain “how to update the kernel version,” including update steps and important considerations.

7. How to Update the Kernel Version

Ubuntu provides periodic kernel updates to improve system performance and strengthen security. Here, we explain how to update the kernel version and important points to watch out for.

Necessity and Benefits of Kernel Updates

Updating to the latest kernel yields the following benefits:

  • Enhanced Security
    The latest kernel includes fixes for previously discovered vulnerabilities, improving system safety.
  • New Feature Support
    New kernel versions may include support for newer hardware or devices.
  • Bug Fixes and Performance Improvements
    Performance optimization and bug fixes can improve system stability.

Steps to Update the Kernel

In Ubuntu, kernel updates are usually handled through standard system updates. Below is a general procedure for updating the kernel.

1. Check for System Updates

First, update the package list and verify the system is up to date. Open a terminal and run:

sudo apt update
sudo apt upgrade

This command updates all packages to the latest version. If a kernel update is available, it will be included in this step.

2. Install a Specific Kernel Version

If you want to manually install a specific kernel version, specify the linux-image package directly:

sudo apt install linux-image-<version>-generic

For example, to install kernel version 5.15, you would run:

sudo apt install linux-image-5.15.0-66-generic

3. Reboot After Kernel Installation

Once the kernel installation is complete, reboot the system to apply the new kernel. The new kernel will not take effect without rebooting.

sudo reboot

After rebooting, use the previously mentioned uname -r or other methods to confirm the kernel version has been updated.

Important Notes for Kernel Updates

  • Check Compatibility
    Updating the kernel may cause compatibility issues with older device drivers or software. Especially for systems or applications that depend on specific versions, confirm compatibility in advance.
  • Backup Recommended
    Perform backups of critical data and system settings before updating the kernel. If the update fails, recovery becomes easier.
  • Retain Old Kernel(s)
    It is advisable to keep older kernel versions for a while in case issues arise with the new one. Normally, Ubuntu retains multiple kernel versions, and you can choose an older version from the GRUB menu at boot time.

8. Conclusion

In this article, we explained in detail how to check the Ubuntu kernel version, the kernel’s structure and role, the correspondence with Ubuntu release versions, and how to update the kernel. The kernel plays a very important role in Linux systems including Ubuntu, and proper version management and timely updates directly affect system stability and security.

  • Roles & Importance of the Kernel
    The kernel bridges hardware and software, managing resources and ensuring security. Therefore, regularly checking its version and updating as needed is highly recommended.
  • Methods to Check Kernel Version
    We introduced multiple methods—uname -r, checking /proc/version, using hostnamectl—as well as GUI approaches, allowing even non-terminal users to confirm the kernel version.
  • Reading Version & Ubuntu Correspondence
    Understanding the structure of the kernel version number helps you identify available features or security patches. Knowing the correspondence between Ubuntu releases and kernel versions is also useful for compatibility checks.
  • Updating Kernel: Steps & Precautions
    We covered how to update the kernel via system updates or manually specifying linux-image, while noting caveats like compatibility, backup, and retaining old kernel versions.

Effective kernel management in Ubuntu is a key factor in maintaining system security and efficiency. By regularly checking and updating the kernel when appropriate, you can maximize your system’s performance and safeguard its integrity. I hope this guide helps Ubuntu users deepen their understanding of kernel management and enables safe and smooth system operations.

侍エンジニア塾