6 Methods To Check The Running Linux Kernel Version On System

There are many commands available in Linux to check running kernel version on your System. In this tutorial we have covered possible commands to find installed/running kernel version and other useful kernel information.

Administrator should know the running kernel version to troubleshoot the driver related issues as these has dependency with kernel. For example, if you are planning to install/upgrade virtualbox, make sure the running kernel version support the application.

Fortunately, it is extremely easy to get this information with uname command, it is one of the very famous command widely used by Linux admin.

This is a small geek but very important one. It’s used to check list of installed Linux kernel on your system which help us to know whether we are running latest kernel or older kernel. If it’s old kernel you can upgrade to latest version with help of below URLs.

Suggested Read :
>: 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 In Ubuntu/LinuxMint

What’s kernel?

A kernel is the central part of an operating system (in other word, core component or heart of an operating system). It’s act as a bridge between applications and hardware. It’s responsible for enabling multiple applications to effectively share the hardware by controlling access to CPU, memory, disk I/O, printer, video card and networking.

When an operating system is loaded into memory, the kernel loads first and remains in memory until the operating system is shut down again.

Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds. The latest version of kernel 4.12 has grown to over 19+ million lines of code contributed by almost 14,000 programmers. Stable kernel updates are released on as-needed basis, usually 2-3 a month.

There are five types of kernels available, but two kernel is more popular monolithic kernels and microkernels.

  • Monolithic Kernels : All operating system services run along with the main kernel thread, thus also residing in the same memory area. It offers rich and powerful hardware access.
  • Microkernels : Microkernels have the same function as monolithic kernels but this designed as very small. It handles only the most basic functions like memory management, multitasking, and inter-process communication. Other services handled by modules or servers.
  • Hybrid Kernels : Hybrid kernels are used in most commercial operating systems. It’s similar to micro kernels, except they include some additional code in kernel-space to increase performance.
  • Nano Kernels : A nanokernel delegates virtually all services, including even the most basic ones like interrupt controllers or the timer to device drivers to make the kernel memory requirement even smaller than a traditional microkernel
  • Exo Kernels : Exokernels in themselves are extremely small. However, they are accompanied by library operating systems (see also unikernel), providing application developers with the functionalities of a conventional operating system.

Method-1 : Using uname Command

uname (stands for unix name) is an utility that prints the system information like name, version and other details about the system and the operating system running on it.

$ uname -a
Linux localhost.localdomain 4.10.14-200.fc25.x86_64 #1 SMP Wed May 3 22:52:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Details :
4 : Kernel Version
10 : Major Revision
14 : Minor Revision
200 : Bug Fix/Revision Detail
fc25 : Distribution name (fc25 – indicate Fedora 25).
x86_64 : Machine architecture

Method-2 : Using /proc/version file

This file specifies the version of the Linux kernel, the version of gcc used to compile the kernel, and the time of kernel compilation. It also contains the kernel compiler’s user name (in parentheses).

$ cat /proc/version
Linux version 4.10.1-041001-generic (kernel@gomeisa) (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) #201702260735 SMP Sun Feb 26 12:36:48 UTC 2017

Method-3 : Using 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.

$ dmesg | grep Linux
[    0.000000] Linux version 4.10.1-041001-generic (kernel@gomeisa) (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 : Using /boot folder

/boot folder contains all the boot related info files and folders such as grub.conf, vmlinuz image aka kernel etc.

$ ls /boot/ | grep vmlinuz
vmlinuz-4.10.1-041001-generic
vmlinuz-4.8.0-53-generic
vmlinuz-4.8.0-54-generic

Method-5 : Using rpm Command

RPM 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 : Using dpkg Command

dpkg stands for Debian package manager (dpkg). dpkg 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

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...

  • James Puerta

    Another way : grep kernel /etc/grub2.cfg 😀

Close
Please support the site
By clicking any of these buttons you help our site to get better