Determining the kernel version of your Linux system is easier than stuffing a large pizza slice into your mouth. Really! 🙂
There are multiple commands you can use to find out the kernel version/release on your system.
Now you might wonder why we need to know the kernel version.
Determining the kernel version is useful for a variety of reasons including diagnosing system errors, upgrading the system and installing correct drivers.
Checking Kernel Version
In this post, we will explore four ways of determining the kernel release.
I have tested the below commands on CentOS 7, Ubuntu 15.04, Linux Mint 17.2, OpenSUSE Leap 42.1 and Mac OS X systems.
The first two commands work fine on all five systems and the last two on all Linux systems but not on Mac OS X.
1. uname -r
I ran the below command on a CentOS 7 Linux system.
$ uname -r 3.10.0-229.20.1.el7.x86_64
Let’s try to understand the output of uname -r in the above example:
3 – Kernel version
10 – Major revision
0 – Kernel patch version
229.20.1 – Custom kernel version from CentOS
el7 – Enterprise Linux 7
x86_64 – Processor Architecture for which Kernel is built
2. uname -a
With uname -a, we get more information including the name of the Linux distribution.
$ uname -a Linux tommy-pc 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
By the way, uname -r and uname -a work on Mac systems too.
3. cat /proc/version
Here’s another simple way to determine the kernel release of your Linux system.
$ cat /proc/version Linux version 3.10.0-229.20.1.el7.x86_64 (email@example.com) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Tue Nov 3 19:10:07 UTC 2015
The above command and the following inxi command do not work on Mac OS X systems.
Abother way of identifying the kernel version on your Linux system is through the extremely useful inxi tool.
Ubuntu and Linux Mint distributions now come with the inxi utility pre-installed.
CentOS and Red Hat users can install inxi via the EPEL repository.
If you’re running OpenSUSE Leap 42.1, grab inxi from the Packman repository.
In the below example, I have run inxi on a Linux Mint 17.2 system.
$ inxi -b System: Host: tommy-pc Kernel: 3.16.0-38-generic x86_64 (64 bit) Desktop: Cinnamon 2.6.13 Distro: Linux Mint 17.2 Rafaela Machine: System: Dell product: OptiPlex 780 Mobo: Dell model: 03NVJ6 version: A02 Bios: Dell version: A14 date: 08/21/2012 CPU: Quad core Intel Core2 Quad CPU Q9400 (-MCP-) clocked at 2660.096 MHz [output truncated]
You get more system information from inxi compared to other tools.