How To Check Installed Linux Kernel in Command Line

In this guide, we want to teach you How to Check or Find an Installed Linux Kernel in the command line. Find or display installed Linux kernels from CLI.

A kernel is the core part of Linux. It is responsible for all major activities of this operating system. It consists of various modules and it interacts directly with the underlying hardware. The kernel provides the required abstraction to hide low-level hardware details in system or application programs.

Check or Find an Installed Linux Kernel in the command line

You can easily use Linux commands to list your installed Linux Kernels. To do this, follow the steps below to see how it works on different Linux distros.

Display Installed Linux Kernels From CLI

To see your installed Linux kernels, follow the steps below.

Centos / RHEL / RedHat / Fedora

On these Linux distros, you can simply use the following commands to list your installed kernels:

rpm -qa kernel

Example output:

Output
kernel-4.18.0-80.7.2.el8_0.x86_64
kernel-4.18.0-80.4.2.el8_0.x86_64

Or you can use yum and dnf to check your installed kernel:

# yum list installed kernel
Or
# dnf list installed kernel

You can follow this link to see the differences between YUM and DNf.

Check the Current Linux Kernel Version

If you want to check your current Kernel version, you can simply use the following command:

# uname -r
# uname -mrs

Example Output:

Output
Linux 4.18.0-80.4.2.el8_0.x86_64

Now let’s see how to find installed kernels on Debian and Ubuntu distros.

Debian / Ubuntu

If you are an Ubuntu or Debian Linux user, you can easily use the following command to list your installed kernels:

dpkg --list | grep linux-image

Example Output:

Output
ii  linux-image-2.6.20-15-generic        2.6.20-15.27                           Linux kernel image for version 2.6.20 on x86/
ii  linux-image-2.6.20-16-generic        2.6.20-16.32                           Linux kernel image for version 2.6.20 on x86/
ii  linux-image-generic                  2.6.20.16.28.1 

Arch Linux

If you are an Arch Linux user, to list your installed kernels, you can use the following command:

pacman -Q | grep linux

OpenSUSE Linux

To see the installed kernels on OpenSUSE, you can use the commands below:

# rpm -qa | grep -i kernel
Or
# zypper search -i kernel

Find Installed Linux Kernels that are not in the Package Manager

You can list your kernels that aren’t in the package manager by locating them in the /lib/modules/ directory using the ls command:

ls -l /lib/modules/

Find Custom Compiled Kernel

vmlinuz is the name of the Linux kernel executable. vmlinuz is a compressed Linux kernel, and it is capable of loading the operating system into memory so that the computer becomes usable and application programs can be run.

To find the custom-compiled kernel, you can use the following command:

sudo find /boot/ -iname "vmlinuz*"

It is also the kernel file but in a non-compressed and non-bootable format. To list files in /boot/ run the ls command:

ls -l /boot/

The Linux kernel is compiled by running the following command:

sudo make install

Conclusion

At this point, you have learned to Check or Find Installed Linux Kernels in Command-Line.

Hope you enjoy it.

You may be like these articles:

How To Upgrade Linux Kernel on Centos 7

Upgrade Linux Kernel on Rocky Linux 8

Upgrade Linux Kernel on Ubuntu 22.04

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!