How To Check CentOS Version? [Latest CentOS Version] – MonoVM

List of content you will read in this article:

  • 1. What is CentOS? [Definition]
  • 2. Why do you need to check CentOS version?
  • 3. How to get CentOS version number?
  • 4. How to check CentOS version using command line
  • 5. Conclusion

There are many reasons for a computer administrator to know about a version of the operating system you are running on your computer or server. These reasons can be for:

  • Can a certain program be installed
  • ?

  • How to fix a specific error
  • ?

  • Should the operating system be updated to a newer version?

These questions people can let you know the version of the operating system on your machine. There is the easiest way to know about the current version of CentOS you are using with the cat /etc/centos-release command. In this tutorial, do we guide you on how to check CentOS version? Before we move, let’s dig deeper first to get to know CentOS.

What is CentOS? [Definition]

CentOS is a free community support platform for Linux-based computing. Red Hat Enterprise officially joined with Linux in 2014. This open-source operating system is famous among administrators, DevOps engineers, and even general users at home. However, CentOS is most commonly used among many organizations for development and production purposes.

Features of CentOS CentOS

allows you to:

  • Perform common everyday tasks
  • .

  • Use the Linux command line
  • . Get a firewall.

  • Get a web server
  • .

  • Share and run folders
  • .

  • Linux with Enhanced Security (SELinux).
  • Additional level of security.

These features, among many others, make CentOS a very attractive platform for users from many different fields of IT and cybersecurity, as well as computer users in general.

Why do

you need to check CentOS version?

As mentioned above, there are many reasons why you will need to check the CentOS version, however, The most common are as follows:

When you want

  • to troubleshoot your system for some error, you need to get the centos version of your system to search for the compatible application or troubleshooting package
  • . When

  • you want to keep your system up to date.
  • When you want to save your system from

  • potential security risks, you need an up-to-date firewall for flawless protection
  • . If you are new to using

  • CentOS and need expert advice from the internet, you should mention the version of the operating system you are using on your system
  • .

  • When you will need to run a disk cleanup.
  • There are frequent updates released at particular times for CentOS, if you don’t know the current version you are using on your system, you won’t be able to know when and how to update centOS.
  • When adding additional IPs to a VPS server

How to get CentOS version number?

The CentOS version has three parts. For example: if you see the following information in the version portion

. 9.2.2010

The explanation would be as follows

. Major version: 9 is the major release version number.

  1. Minor version: 2 is the minor release version number
  2. .

  3. Monthstamp: codebase month October and year the timestamp is 2020.


How to check

CentOS version using command line

So, let’s discuss how to check the version of centos you are using on your system. There are several ways, and you can use any of them to find out the version.

1. /etc/redhat-release


The RedHat Linux distribution file also contains version information. For the information, type the

following Linux command: cat /etc/redhat-release The following output

is all you want

: CentOS Linux version 8.1.1911 (Kernel) 2. /etc/centos-release file

For CentOS-specific file type

: cat /etc/centos-release

The output will be as follows:

CentOS Linux version 8.1.1911 (Kernel)




Type the following command to find the CentOS version:

cat /etc/system-release

You will have the following output:

CentOS Linux version 8.1.1911 (Core)

4. lsb_release

command You will need to install this command on your operating system

because this command does not come pre-installed on your operating system.

Type the following


yum install redhat-lsb

Then type this command

: lsb_release -d You will see the following output:

Description: CentOS Linux release 8.1.1911 (Core)



/etc/os-release file

When you want to know the major version of your operating system, you must type the following command


cat /etc/os-release

The output you will get will be detailed information about the main series and numbers, and it will look like this

: NAME=”CentOS Linux” VERSION=”8 (Core)” ID=”centos” ID_LIKE=”rhel fedora” VERSION_ID=”8″ PLATFORM_ID=”platform:el8″ PRETTY_NAME=”CentOS

Linux 8
















This simplest macro evaluation is enough to give you the right answer as well. Just type

: rpm -E %{rhel}

You will

see: 8

You can also use the following command

: rpm –

eval %{centos_ve}

The output will be the same as before





see Use rpm CentOS release to know the answer to your question.


: rpm -q centos-release The output will be as follows:



8. hostnamectl command You can use the hostnamectl command as

follows to get the system information: hostnamectl

Here is the result:

Static hostname:


Transient hostname:

Icon name: computer-vm

Chassis: vm

Machine ID: c2a4bfa7e0c74457b3a978656ab959e8 Boot ID: c89bae2d3ec7493987a455bfa15e4818

Virtualization: kvm

Operating System:

CentOS Linux 7 (Core)

CPE Operating System Name: cpe:/o:centos:centos:7

Kernel: Linux 3.10.0-1062.12.1.el7.x86_64

Architecture: x86-64

To view only the OS version, type


hostnamectl | grep

“Operating System”

And you will see


Operating system: CentOS Linux 7 (Core)

9. Kernel execution version

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

: Input: # uname -s -r Output: Linux 3.10.0-693.21.1.el7.x86_64 Input: # 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/


Kernel compile time

(uname -v) with known value: Input: #

uname -v



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

. Check with GRUB configuration files

This is the most unusual way to check the version of CentOS on your system

. CentOS 7 Example input:

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



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

of Input


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


title Title CentOS (2.6.32-696.20.1.el6.x86_64) CentOS




Throughout this blog, we have given you the most common and uncommon ways to check the centos version of CentOS and the kernel you have installed on your system. Let us know how these steps helped you in the comments below.

People are also reading:

  • Linux Kernel Version Command
  • How to update CentOS kernel? Disk Cleanup Methods on

  • CentOS How to
  • change SSH port on Centos?
  • Linux
  • file permissions