Signup/Sign In

How To Check Your CentOS Version

Knowing the CentOS version can help you determine the features, security updates, compatibility, and support options for your system. You may need it for troubleshooting, bug fixes, and many other reasons.

CentOS stands for Community ENTerprise 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.

Check CentOS Version

There are numerous techniques that you may use to ascertain the CentOS version. This article teaches you the 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:

  1. Using the /etc/centos-release file
  2. Using the lsb_release command
  3. Utilizing the hostnamectl command

We will begin with the easiest and reliable way, using the /etc/centos-release” file.

1. Check CentOS Version Using /etc/centos-release File

This is one of the simplest and reliable techniques for collecting the version data of the CentOS operating system. The version information are provided within the “/etc/centos-release” file.

You may read the version data file of the CentOS operating system easily by using the cat command:

$ cat /etc/centos-release

Checking Cent OS version with /etc/os-release file

Here, we get the result of the command, which reveals that the release version number is 8.4.2105.

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 “2105”, which is further separated into two parts: “21” represents the year that the CentOS operating system was introduced (2021) and “05” specifies the month, which is march (05).

2. Check CentOS Version Using lsb_release command

You can check version information of CentOS operating system by simply entering the commands provided below:

The lsb_release command needs the “redhat-lsb-core” package to operate. First, you need to install it using "yum install redhat-lsb-core” command. Here is a related guide on installing a package in CentOS.

lsb_release -d

After the relevant packages have been successfully installed, the lsb_release program will output the required information.

Description: CentOS Linux release 8.4.2105

3. Check CentOS version with hostnamectl command

To retrieve the branch number of the CentOS operating system, the hostnamectl command may be used as indicated below.


Checking CentOS version with hostnamectl command

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

This method is not recommended, as it works only if your system is booted with systemd.


Here are some common questions related to CentOS asked by people on the internet:

Q. What is the simplest way to check centos version?

You can check centos version by just executing “cat /etc/centos-release” command.

Q. How to check CentOS version using lsb_release command?

You can check version information of CentOS operating system by simply entering the lsb_release -d command.

Q. How to find kernel version and architecture of CentOS system?

You can use these commands to find out the kernel version and architecture of your CentOS system:

  • uname -r : displays the kernel release number.
  • uname -m : shows the machine hardware name or architecture.

Q. Is there any way to check CentOS version from the graphical interface?

Yes, you can check the CentOS version from system settings or menus with a graphical desktop environment such as GNOME or KDE.

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.

About the author:
Pradeep has expertise in Linux, Go, Nginx, Apache, CyberSecurity, AppSec and various other technical areas. He has contributed to numerous publications and websites, providing his readers with insightful and informative content.