Linux Kernel is the core component of a GNU/Linux operating system. It is a free, opensource, monolithic, modular, multitasking, Unix-like operating system kernel. It is created by Linus Torvalds for his i386 PC in 1991. We can install more than one Kernel in our system. Ever wondered how many Linux Kernels you have installed in your Linux box? No? Well, this brief tutorial will teach you how to view or check all installed Linux Kernels along with their versions from commandline in different Linux operating systems.
Check All Installed Linux Kernels From Commandline
Depending upon the Linux distribution you use, there are multiple ways to check all installed Linux kernel details in your system. The easiest and quickest way to check all installed Kernels in a Linux is by using
By default, all installed Linux Kernels and their associated files are stored under
/boot directory. Simply check the contents of this directory using
find command to view the list of installed Kernels:
$ find /boot/vmli*
Sample output from my Ubuntu 20.04 LTS desktop:
/boot/vmlinuz /boot/vmlinuz-5.4.0-64-generic /boot/vmlinuz-5.4.0-65-generic /boot/vmlinuz.old
As you see in the above output, there are two Linux Kernels versions (5.4.0-64 and 5.4.0-65) are installed in my Ubuntu desktop machine.
Now we will see distribution-specific methods to find out installed Linux kernel details. First, let us start from Alpine Linux.
1. Check installed Kernels in Alpine Linux
We can check all installed Kernels along with their versions using the following apk command:
$ apk info -vv | grep linux
libblkid-2.32-r0 - Block device identification library from util-linux linux-virt-4.14.167-r0 - Linux vanilla kernel syslinux-6.04_pre1-r1 - Boot loader for the Linux operating system
2. List installed Kernels in Arch Linux
To view all installed in Arch Linux and its variants like Manjaro Linux, run the following pacman command:
$ pacman -Q linux
You can also combine pacman and grep commands to list installed Kernel versions:
$ pacman -Q | grep linux
archlinux-keyring 20201210-1 linux 5.9.14.arch1-1 linux-api-headers 5.8-1 util-linux 2.36.1-4 util-linux-libs 2.36.1-4
As you can see, I have only one Linux Kernel in my Arch Linux system and its version is 5.9.14.
3. Find installed Linux Kernels in Debian, Ubuntu, Pop!_OS
In Debian and other Debian-based systems like Ubuntu, Pop!_OS, Linux Mint, we can find the list of all installed Kernels using
$ dpkg --list | grep linux-image
ii linux-image-5.4.0-64-generic 5.4.0-64.72 amd64 Signed kernel image generic ii linux-image-5.4.0-65-generic 5.4.0-65.73 amd64 Signed kernel image generic ii linux-image-generic 220.127.116.11.68 amd64 Generic Linux kernel image
4. View installed Kernels in Fedora, CentOS, RHEL, AlmaLinux
In RPM-based systems such as Fedora and its downstream versions such as CentOS, RHEL and RHEL-clones such as AlmaLinux, we can view all installed Kernels using
rpm command like below:
$ rpm -qa kernel
$ rpm -qa | grep -i kernel
Sample output from Fedora 33:
Sample output from AlmaLinux 8.3:
5. List all installed Linux Kernels in openSUSE
Since openSUSE is also a RPM-based system, the command to list all installed Linux Kernels is same as Fedora, RHEL distributions.
$ rpm -qa | grep -i kernel
Bonus tip - View only current Kernel details
To view the currently running Kernel, run:
$ uname -r 5.4.0-65-generic
$ uname -mrs Linux 5.4.0-65-generic x86_64
You know now the list of installed Kernels on your Linux system. How would you find when a specific Linux Kernel version is last booted? That's easy! Refer the following guide to check when a Linux kernel last used or booted on.
Hope this helps.