There are several commands on Linux to check the kernel version running on your system.In this tutorial we have covered the possible commands to find the installed/running kernel version and other useful kernel information.
The Linux administrator should be aware of the kernel version running as it is dependent on the kernel to fix driver-related issues.
For example, if you plan to install or upgrade a VirtualBox, make sure that the kernel version running before the installation is supported.
This information is very easy to obtain with the uname command, which is the most popular command widely used by the Linux administrator.
This is a small geek but one of the most important. It is used to check the list of Linux kernels installed on your computer, and it can also help you to see if the latest kernel or older kernel is running.
If this is an older kernel, you should upgrade to the latest version with the help of the URLs below.
- Ukuu – An Easy Way To Install/Upgrade Linux Kernel In Ubuntu based Systems
- Linux Kernel Utilities (LKU) – A Set Of Shell Scripts To Compile, Install & Update Latest Kernel on Ubuntu
What is Kernel?
A kernel is the central part of an operating system (in other words, the main component or the heart of the operating system). It acts as a bridge between applications and hardware.
It is allowing for enabling multiple applications to share hardware efficiently by controlling access to CPU, memory, disk I / O, printer, video card and networking.
When an operating system is loaded into memory, the kernel stays in memory until it is first loaded and the operating system is shut down again.
Linux is a clone of the operating system Unix, written by Linus Torvalds.
The latest version of Kernel 5.4 has grown to more than 27.8 million codes contributed by nearly 14,000 programmers. The stable kernel updates are released on demand, usually every 2-3 months.
There are five types of kernels available, but the two most popular kernels are the monolithic kernel and the micro kernel.
- Monolithic Kernel: All operating system services run with the main kernel thread, thus residing in the same memory area. It provides access to rich and powerful hardware.
- Microkernel: Microkernel works much like monolithic kernels, but it is designed to be very small. It handles only the most basic functions such as memory management, multitasking and inter-process communication. Modules or server is handled other services.
- Hybrid Kernel: Hybrid kernel is a kernel architecture based on a combination of micro kernel and monolithic kernel architecture used in computer operating systems, which added some extra code to the kernel-space to increase performance.
- Nano Kernel: Nano kernel is a small kernel that provides hardware abstraction, but without computer services. This kernel is smaller than a traditional micro kernel.
- Exokernel: Exokernel is a type of operating system developed at the Massachusetts Institute of Technology that seeks to provide application-level management of hardware resources.
Method-1: How to check the Linux Kernel version running on Linux using the uname Command
uname (refers to the UNIX name) is an application that prints system information such as the host name, Linux kernel version and other details of the operating system on which it is running.
$ uname -a Linux daygeek-Y700 4.19.96-1-MANJARO #1 SMP Wed Jan 15 08:41:50 UTC 2020 x86_64 GNU/Linux
Details: -------- 4: Kernel Version 19: Major Revision 96: Minor Revision 1: Bug Fix/Revision Detail MANJARO: Distribution Name x86_64: Machine Architecture
Method-2 : How to check the Linux Kernel version running on Linux using the /proc/version File
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information.
It’s sometimes referred to as a process information pseudo-file system. It doesn’t contain ‘real’ files but run time system information (e.g. system memory, devices mounted, hardware configuration, etc).
This file shows the version of the Linux kernel, the GCC version used to compile the kernel, and the time of the kernel package. It also contains the username of the kernel compiler (in parentheses).
$ cat /proc/version Linux version 4.19.96-1-MANJARO ([email protected]) (gcc version 9.2.0 (GCC)) #1 SMP Wed Jan 15 08:41:50 UTC 2020
Method-3: How to check the Linux Kernel version running on Linux using the dmesg Command
dmesg (stands for display message or driver message) is a command on most Unix-like operating systems that prints the message buffer of the kernel.
$ sudo dmesg | grep Linux [ 0.000000] Linux version 4.10.1-041001-generic ([email protected]) (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) #201702260735 SMP Sun Feb 26 12:36:48 UTC 2017 [ 0.834292] Linux agpgart interface v0.103 [ 0.854838] usb usb1: Manufacturer: Linux 4.10.1-041001-generic ehci_hcd [ 0.915808] usb usb2: Manufacturer: Linux 4.10.1-041001-generic ohci_hcd
Method-4: How to check the Linux Kernel version running on Linux using the “/boot” Directory
The “/boot” directory contains all the boot-related information files and folders such as grub.conf, vmlinuz image aka kernel.
$ ls -lh /boot | egrep "initramfs|vmlinuz|linux" -rw-r--r-- 1 root root 28M Jan 18 17:43 initramfs-4.19-x86_64-fallback.img -rw-r--r-- 1 root root 8.3M Jan 18 17:43 initramfs-4.19-x86_64.img -rw-r--r-- 1 root root 22 Jan 15 14:11 linux419-x86_64.kver drwxr-xr-x 2 root root 4.0K Dec 23 11:25 syslinux -rw-r--r-- 1 root root 5.7M Jan 18 17:42 vmlinuz-4.19-x86_64
Method-5: How to check the Linux Kernel version running on Linux using the rpm Command
RPM command stands for RedHat Package Manager is a powerful, command line package management utility for Red Hat based system such as CentOS, Oracle Linux & Fedora.
$ rpm -q kernel kernel-4.9.12-200.fc25.x86_64 kernel-4.10.10-200.fc25.x86_64 kernel-4.10.14-200.fc25.x86_64
Method-6: How to check the Linux Kernel version running on Linux using the dpkg Command
dpkg command stands for Debian package manager (dpkg). It is a command-line tool to install, build, remove and manage Debian packages. dpkg uses Aptitude (primary and more user-friendly) as a front-end to perform all the actions.
$ dpkg -l | grep linux-image ii linux-image-4.10.1-041001-generic 4.10.1-041001.201702260735 amd64 Linux kernel image for version 4.10.1 on 64 bit x86 SMP ii linux-image-4.8.0-53-generic 4.8.0-53.56 amd64 Linux kernel image for version 4.8.0 on 64 bit x86 SMP ii linux-image-4.8.0-54-generic 4.8.0-54.57 amd64 Linux kernel image for version 4.8.0 on 64 bit x86 SMP ii linux-image-extra-4.8.0-53-generic 4.8.0-53.56 amd64 Linux kernel extra modules for version 4.8.0 on 64 bit x86 SMP ii linux-image-extra-4.8.0-54-generic 4.8.0-54.57 amd64 Linux kernel extra modules for version 4.8.0 on 64 bit x86 SMP ii linux-image-generic 4.8.0.54.66 amd64 Generic Linux kernel image
Another way : grep kernel /etc/grub2.cfg 😀