CentOS

How to Check the CentOS Version

How to Check the 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 configuration of software repositories or installation of any software, it is extremely important to get the right version of the software so that the solution is compatible with the operating system version. This article shows you various methods for determining the version of CentOS.

Checking the CentOS Version

There are multiple methods that you can use to determine the CentOS version. This article shows you the three most effective and efficient methods that will work on any version of the CentOS operating system. The methods included in this article for checking the CentOS system version are as follows:

We will begin with the simplest method using the /etc/centos-release file.

Check CentOS Version Using /etc/centos-release File

This is one of the simplest and easiest methods for getting the version details of the CentOS operating system. The version details are placed inside the /etc/centos-release file. You can get the version details of the CentOS operating system simply by using the cat command:

$ cat /etc/centos-release

Here, we have the output of the command, which shows that the release version number is 8.3.2011. The following shows you more information about the version number.

The version number of the CentOS operating system consists of three major parts.

Check CentOS Version Using lsb_release Command

You can also use the lsb_release command to get the version details of the CentOS operating system. Simply type the command given below:

$ lsb_release -a

The lsb_release command requires the “redhat-lsb-core” package to execute. If this package is not installed on your CentOS system, then you will be prompted to install the “redhat-lsb-core” package. Type “y” and press “Enter” to allow the installation of the “redhat-lsb-core” package:

Also, allow the installation of additional packages by typing “y” and pressing the “Enter” button:

After the required packages have been successfully installed, the lsb_release command will print the required information. The version information will be written in the “Description” and “Release” entries and subsequent lines.

Check CentOS Version Using hostnamectl Command

To get the branch number of the CentOS operating system, the hostnamectl command can be used as given below. This command will print all the required details for the CentOS operating system:

$ hostnamectl

The hostnamectl command has printed a rather lengthy output, but the version-relevant information is “Operating System: CentOS Linux 8.”

Conclusion

This post provided three useful methods for determining the version of the CentOS operating system. Knowing the version of the CentOS Operating system will ensure that you can install compatible software and troubleshoot any problems with the CentOS operating system.

SuperTuxKart for Linux
SuperTuxKart is a great title designed to bring you the Mario Kart experience free of charge on your Linux system. It is pretty challenging and fun to...
Battle for Wesnoth Tutorial
The Battle for Wesnoth is one of the most popular open source strategy games that you can play at this time. Not only has this game been in developmen...
0 A.D. Tutorial
Out of the many strategy games out there, 0 A.D. manages to stand out as a comprehensive title and a very deep, tactical game despite being open sourc...