Signup/Sign In

How To Check Your CentOS Version

check centos version

For troubleshooting, bug fixes, and many other reasons, you may need to know the version of the operating system. Particularly when it comes to the setup of software repositories or installation of any program, it is highly crucial to have the proper version of the software so that the solution is compatible with the operating system version. This article gives you numerous techniques for finding the version of CentOS.

Checking the CentOS Version

There are numerous techniques that you may use to ascertain the CentOS version. This article teaches you the three most effective and efficient approaches that will work on any version of the CentOS operating system. The techniques given in this article for testing the CentOS system version are as follows:

  • Using the /etc/centos-release file
  • Using the lsb release command
  • Utilizing the hostnamectl command

We will begin with the easiest way using the /etc/centos-release file.

Check CentOS Version Using /etc/centos-release File

This is one of the simplest and easiest techniques for collecting the version data of the CentOS operating system. The version information are provided within the /etc/centos-release file. You may acquire the version data of the CentOS operating system easily by using the cat command:

$ cat /etc/centos-release

Here, we get the result of the command, which reveals that the release version number is 8.3.2011. The following offers you further information about the version number.

The version number of the CentOS operating system consists of three key sections.

  • The first element is the “8,” which identifies the principal branch of CentOS.
  • The second element is “3,” which represents the latest minor release.
  • The final portion is “2011,” which is further separated into two parts: “20” represents the year that the CentOS operating system was introduced (2020) and “11” specifies the month, which is November (11).

Check CentOS Version Using lsb release Command

You may also use the lsb release tool to acquire the version information of the CentOS operating system. Simply enter the instruction provided below:

$ lsb release -a

The lsb release command needs the “redhat-lsb-core” package to operate. If this package is not installed on your CentOS system, then you will be required to install the “redhat-lsb-core” package. Type “y” and press “Enter” to accept the installation of the “redhat-lsb-core” package:

Also, authorize the installation of other packages by entering “y” and hitting the “Enter” button:

After the relevant packages have been successfully installed, the lsb release program will output the required information. The version information will be provided in the “Description” and “Release” sections and succeeding lines.

Check CentOS Version Using hostnamectl Command

To retrieve the branch number of the CentOS operating system, the hostnamectl command may be used as indicated below. This command will output all the needed information for the CentOS operating system:

$ hostnamectl

The hostnamectl command has returned a very long result, but the version-relevant information is “Operating System: CentOS Linux 8.”


This article presented three handy ways for finding the version of the CentOS operating system. Knowing the version of the CentOS Operating system helps guarantee that you can install suitable applications and fix any difficulties with the CentOS operating system.