How To Check Your Kernel Version In Linux

In this quick post I will be showing you how to check your kernel version as-well as list your installed kernel versions. So lets begin by checking which kernel you are currently running.

Check Kernel Version

You can check the kernel version you are currently running using the uname command. The uname command can do more than just show which kernel you are running, here are 2 examples. The first example will show the entire output of uname, the second will only show the actual kernel version.

uname -a
root@ubuntu:~# uname -a
Linux ubuntu 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

uname -r
root@ubuntu:~# uname -r
4.10.0-19-generic

List All Bootable Kernels

You can get a list of all your bootable kernels by running the following command, this should work on all Linux distributions but if I am wrong about that then please let me know. For this example I only have 1 kernel installed, if there were more they would all be listed below, with the last part of each line being the actual kernel version.

ls -l /boot | grep img

root@ubuntu:~# ls -l /boot | grep img
-rw-r--r-- 1 root root 42965802 Sep  4 10:11 initrd.img-4.10.0-19-generic

List All Installed Kernels

You can search your installed packages for all installed kernel versions using yum and dpkg depending on which distribution you are running. For Debian, Ubuntu, and Linux Mint you will use the dpkg options. For Red Hat, Cent OS, and Fedora you will use the yum option. Note that they may display more packages than just the actual kernels themselves.

dpkg -l | grep "kernel"
OR
yum list installed | grep "kernel"

I hope you enjoyed this post, please don’t forget to like/comment/share. Thanks for the support!

Leave a Reply

Your email address will not be published. Required fields are marked *