How to check Linux version

It is important to know which version of Linux kernel you are running because many software or libraries require that certain kernel subsystems and features be available in order for them to run properly. Knowing the kernel version can also be helpful in diagnosing systems or debugging software problems.

If you would like to know which kernel version is running, you can check Linux kernel version by using uname command. In the example below, it shows that you are running a Linux kernel 2.6.32.

$ uname -r
2.6.32-220.el6.x86_64

Another way to check Linux kernel version is via /proc/version.

$ cat /proc/version
Linux version 2.6.43.5-2.fc15.x86_64 (mockbuild@x86-11.phx2.fedoraproject.org) (gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC) ) #1 SMP Tue May 8 11:09:22 UTC 2012

If you would like to know the version number of your Linux distribution (e.g., Debian, Ubuntu, CentOS, etc.), you can follow the distribution-specific instructions below.

To check Debian version number:

$ cat /etc/debian_version
5.0.7
$ cat /etc/issue
Debian GNU/Linux 5.0 \n \l 

To check Ubuntu version number:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"
$ cat /etc/issue
Ubuntu 10.04.4 LTS \n \l 

To check CentOS version number:

$ cat /etc/*-release
CentOS release 6.2 (Final)

To check RedHat version number:

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.0 (Santiago)

To check Fedora version number:

$ cat /etc/fedora-release
Fedora release 14 (Laughlin) 

To check OpenSuSE version number:

$ cat /etc/SuSE-release
openSUSE 12.1 (x86_64)
VERSION = 12.1
CODENAME = Asparagus

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of Xmodulo.com. He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.
Your name can also be listed here. Write for us as a freelancer.

Leave a comment

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

Current ye@r *