+370 5 205 5502 sales@monovm.com

Did you forget what your CentOS version is? With a few commands you can easily check and find the CentOS version.


Nov, 20

Step-by-step Guide to Find The CentOS Version

There are numerous reasons that you will need to find the CentOS version you are using on your computer. Can I install this program? How can I fix this problem? This among many other reasons can be why you need to know the CentOS server version. Before getting in depth, let’s get to know a bit about CentOS.

What is CentOS?

CentOS is a free community support platform for computing that is based on Linux. Red Hat Enterprise joined officially with Linux in 2014.

This open-source operating system is famous among administrators, DevOps engineers, and even among general users at home. However CentOS is used among many organizations for development and production purposes.

CentOS allows you to:

  • Perform common tasks
  • Use command line
  • Get a firewall
  • Get a web server
  • Folders sharing and running
  • Security-enhanced Linux (SELinux)
  • Additional level security

Why do you need to find the CentOS version?

As explained before there are a lot of reasons why you will need to find the CentOS version, however the most common reasons are as follows:

  • When you want to troubleshoot your system for some error you need to know the version of your system to look for the compatible app or problem solution pack.
  • When you want to keep your system up-to-date.
  • When you want to save your system from potential security risks you need an updated firewall for flawless protection.
  • If you are new at using CentOS and need some expert advice from the internet you need to tell about the version you are using on your system.
  • When you are searching for the solution to a particular issue for the swift solution you need to download the most compatible solution to the version of CentOS you are using.
  • When you want to describe your problem you need to tell about the distributor who has provided you the OS for Linux.
  • When you will need to run a disk cleanup.
  • There are frequent updates launched at particular times for CentOS, if you don’t know about the current version you are using on your system you won’t be able to know when and how to update your OS.
  • When adding extra IPs to a VPS server

How to read CentOS Version Number?

CentOS version has three parts. For example:

If you see the following information in the version part. 9.2.2010

The explanation would be as follows.

  1. Major Version: 9 is the major release version number
  2. Minor Version: 2 is minor release version number
  1. Monthstamp: codebase month October and year timestamp is 2020

 find centos version in command line

How to check CentOS version using “Command Line”:

So let's discuss how to find a version of the CentOS you are using on your system. There are various ways possible and you can use any of them to know about the version. We have discussed some most common and obvious ways and some uncommon ways for you to learn about the version.

Without further ado here is the way:


1. /etc/redhat-release file

The RedHat Linux distribution file also contains information about the version.

To get the information type the following command:

[root@centos ~]# cat /etc/redhat-release

The following output is all you want:

CentOS Linux release 8.1.1911 (Core)

[root@centos ~]#


2. /etc/centos-release file

For the CentOS specific file type:

[root@centos ~]# cat /etc/centos-release

The output will be as follow:

CentOS Linux release 8.1.1911 (Core)

[root@centos ~]#

  • Major Version: 8
  • Minor Version: 1
  • Monthstamp: 1911 i.e. November 2019.


3. /etc/system-release file

Type the following command to look for the version of CentOS:

[root@centos ~]# cat /etc/system-release

You will have the following output:

CentOS Linux release 8.1.1911 (Core)

[root@centos ~]#


4. lsb_release command

You need to install this command into your OS because this command doesn’t come preinstalled in your OS.

Write the following:

[root@centos ~]# yum install redhat-lsb


Then type this command:

[root@centos ~]#  lsb_release –d

You will see the following output:

Description:    CentOS Linux release 8.1.1911 (Core)

[root@centos ~]#

 lsb_release command on CentOS

5. /etc/os-release file

When you want to know about the major version of your OS you need to type the following commands:

[root@centos ~]# cat /etc/os-release

The output you get will be detailed information regarding major serials and numbers.

NAME="CentOS Linux"

VERSION="8 (Core)"


ID_LIKE="rhel fedora"



PRETTY_NAME="CentOS Linux 8 (Core)"











[root@centos ~]#


6. rpm macro

this simplest macro evaluation is enough to give you the right answer as well.

Just type:

[root@centos ~]# rpm -E %{rhel}

You will see:


[root@centos ~]# rpm –eval %{centos_ve}

[root@centos ~]#


 rpm macro command in CentOS

7. rpm query

Use rpm centos release to know the answer to your question.


[root@centos ~]# rpm -q centos-release

The output will be as follow:


[root@centos ~]#

 rpm query command

8. hostnamectl command

You can use the hostnamectl command in the following way to get the system information:

[root@centos ~]# hostnamectl

Here is the output:

   Static hostname: localhost.localdomain

Transient hostname: li1176-240.members.linode.com

         Icon name: computer-vm

           Chassis: vm

        Machine ID: c2a4bfa7e0c74457b3a978656ab959e8

           Boot ID: c89bae2d3ec7493987a455bfa15e4818

    Virtualization: kvm

  Operating System: CentOS Linux 7 (Core)

       CPE OS Name: cpe:/o:centos:centos:7

            Kernel: Linux 3.10.0-1062.12.1.el7.x86_64

      Architecture: x86-64

[root@centos ~]#

[root@centos ~]#

[root@centos ~]# hostnamectl | grep "Operating System"

  Operating System: CentOS Linux 7 (Core)

[root@centos ~]#


9. Running Kernel version

When you want to know about CentOS kernel architecture, use one of the following ways:


# uname -s -r


Linux 3.10.0-693.21.1.el7.x86_64


# uname -a


Linux geeklab 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


Kernel compile time

(uname -v) with known value:


# uname –v


#1 SMP Wed Mar 7 19:03:37 UTC 2018


10. Check with GRUB configuration files

This is the most uncommon way to check for the version of CentOS on your system.

CentOS 7 Example


# cat /boot/grub2/grub.cfg | grep -w menuentry


menuentry 'CentOS Linux (3.10.0-693.21.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.21.1.el7.x86_64-advanced-0f790447-ebef-4ca0-b229-d0aa1985d57f' {

menuentry 'CentOS Linux (3.10.0-693.17.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.17.1.el7.x86_64-advanced-0f790447-ebef-4ca0-b229-d0aa1985d57f' {

Another version for the grub file:


# grep saved_entry /boot/grub2/grubenv


saved_entry=CentOS Linux (3.10.0-693.21.1.el7.x86_64) 7 (Core)


CentOS 6 Example


# cat /boot/grub/grub.conf | grep title


title CentOS (2.6.32-696.20.1.el6.x86_64)

title CentOS (2.6.32-696.18.7.el6.x86_64)


Over to you

We have tried to provide you the most common and uncommon ways to check the version of CentOS and Kernel you have installed on your system. Use any of them and know the answer to your million dollar question. Let us know how these steps helped you in the comments below.

Antoniy Yushkevych

Master of word when it comes to technology, internet and privacy. I'm also your usual guy that always aims for the best result and takes a skateboard to work. If you need me, you will find me at the office's Counter-Strike championships on Fridays or at a.yushkevych@monovm.com