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
Or you can use yum and dnf to check your installed kernel:
# yum list installed kernel
# 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
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
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 18.104.22.168.28.1
If you are an Arch Linux user, to list your installed kernels, you can use the following command:
pacman -Q | grep linux
To see the installed kernels on OpenSUSE, you can use the commands below:
# rpm -qa | grep -i kernel
# 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
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: