Oct 9, 2023 3 min read

How to Check the Kernel Version on Linux

Check the Kernel Version on Linux with our step-by-step tutorial. It is the core software component of an operating system.

Check the Kernel Version on Linux
Table of Contents

Introduction

Before we begin talking about how to check the kernel version on Linux, let's briefly understand – What is Kernel ?

A kernel is the core software component of an operating system. It acts as a bridge between applications and the computer hardware, managing resources like memory, processors, and input/output devices.

Essentially, the kernel enables communication and coordination between different parts of the system, allowing software to run smoothly on a machine. Understanding the kernel's significance is crucial for anyone interested in the inner workings of an operating system.

In this tutorial, you will check the kernel version on Linux. We will also address a few FAQs on how to check the kernel version on Linux.

Advantages of Kernel

  1. Efficiency: The kernel optimizes resource allocation, resulting in faster and more efficient operations.
  2. Stability: With its robust design and error-handling capabilities, the kernel ensures system stability and prevents crashes or freezes.
  3. Security: The kernel provides essential security measures, protecting the system from unauthorized access and malicious software.
  4. Flexibility: Through modularity, the kernel allows for easy customization and extension, accommodating diverse hardware and software configurations.
  5. Interoperability: The kernel facilitates seamless interaction between applications and hardware, enabling the smooth functioning of the entire system.

Using the uname Command

Linux kernel architecture, name version, and release may all be seen using the uname command.

The following command may be used to determine the version of the Linux kernel currently installed on your machine:

uname -srm
Output

Linux 4.15.0-54-generic x86_64

The result above confirms that the current version of the Linux kernel is 4.15.0-54 and that it is 64-bit, where:

  • 4 - Kernel-Version.
  • 15 - Major Revision.
  • 0 - Minor Revision.
  • 54 - Patch number.
  • generic - Distribution specific information.

Using hostnamectl command

The hostnamectl tool, which is built into systemd, may be used to see or modify the hostname of the system. Furthermore, the Linux distribution and kernel version are shown:

hostnamectl
Output

Static hostname:  linuxize.localdomain
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: af8ce1d394b844fea8c19ea5c6a9bd09
           Boot ID: 15bc3ae7bde842f29c8d925044f232b9
  Operating System: Ubuntu 18.04.2 LTS
            Kernel: Linux 4.15.0-54-generic
      Architecture: x86-64

To filter out the Linux kernel version, use the grep command:

hostnamectl | grep -i kernel
Output

Kernel: Linux 4.15.0-54-generic

Using /proc/version File

The /proc directory contains virtual files that contain information about system memory, CPU cores, mounted filesystems, and more. The /proc/version file stores information about the running kernel.

To see the contents of the file, type cat or less.

cat /proc/version

The output will look something like this:

Output

Linux version 4.15.0-54-generic (buildd@lgw01-amd64-014) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019

FAQs to Check the Kernel Version on Linux

Are there alternatives to the uname -r command? 

Yes, you can use commands like uname -a to display more detailed information, including the kernel version, or cat /proc/version to see additional details.

Can I check the kernel version using a graphical interface? 

Yes, most Linux distributions provide graphical tools like "System Information" or "About" sections in settings that display system details, including the kernel version.

What does the kernel version number consist of? 

The kernel version number typically consists of three parts: major version, minor version, and a revision number. For example, 4.15.0.

How often does the kernel version change? 

The kernel version changes frequently, with major releases every few months. However, the frequency can vary depending on the distribution and updates.

Can I upgrade or downgrade the kernel version? 

Yes, it is possible to upgrade or downgrade the kernel version. Various methods, such as package managers or manually compiling the kernel, can be used depending on the distribution.

Is it necessary to update the kernel? 

It is recommended to keep the kernel up to date as new versions often bring bug fixes, security patches, and performance improvements. However, stability and compatibility should also be considered.

Can I have multiple kernel versions installed on my Linux system?

 Yes, it is possible to have multiple kernel versions installed. This allows you to choose the desired version at system boot, which can be useful for troubleshooting or compatibility purposes.

Conclusion

This tutorial has shown you how to use the command line to determine the version of the Linux kernel installed on your computer. The instructions are tested on Debian, Red Hat, Ubuntu, Arch Linux, Fedora, CentOS, Kali Linux, Open SUSE, Linux Mint, and other major Linux distributions.

If you have any queries, please leave a comment below and we’ll be happy to respond to them.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.