It is important to know your CentOS release for system administration, troubleshooting, and installing compatible software. The features and support for CentOS Stream 9 or 10 differ significantly from CentOS 7 and CentOS 8. You can quickly and easily check your CentOS version, whether you manage a local server environment or a cloud-based one.
This guide will show you the fastest and most reliable way to find your CentOS version.
Table of Contents
How to Check the CentOS Version?
CentOS is an open-source, free Linux operating system based on Red Hat Enterprise Linux. It’s designed to be stable, secure, and scalable for enterprise computing environments. Let’s start with the centos-release file.
Method 1: Using a centos-release File
The “cat” command displays the contents of the file. Use the “cat” command to get the CentOS version. You will need to specify the file name /etc/centos release.
cat /etc/centos-release |
---|

This output shows the CentOS version installed on our machine as “10 (Coughlan)”.
Method 2: Using /etc/os-release
Displaying the OS Release Information File is another reliable way to do this.
cat /etc/os-release |
---|

It contains structured information about your operating systems. Many applications and scripts use it to detect compatibility. It includes detailed fields like NAME, VERSION, and PRETTY_NAME.
Method 3: Using hostnamectl Command
Use the “hostnamectl” command to check the version of CentOS installed:
hostnamectl |
---|

The output shows detailed information about the current operating system, including the version.
Method 4: Using the uname Command
Users can use the “uname” with the “r” option to display the current version of CentOS. Execute the script below:
uname -r |
---|

This command displays the kernel version. It can be used as a tool to determine which version of CentOS is installed.
Method 5: Using the rpm Command
Use the rpm command in order to check the version of CentOS installed.
rpm -q centos-release |
---|

This command displays the version number of the CentOS release package. It can be used as a tool to determine which version of CentOS is installed.
Method 6: Using GUI
If you are using CentOS and a graphical desktop. To do so, go to Settings, then navigate to the About section and see the CentOS version:

The “About” section in the graphical interface shows OS version, kernel, and architecture. This feature is especially useful for those users who prefer a GUI to the command line.
Conclusion
You can check the CentOS version using several simple commands. The cat /etc/centos release is the most commonly used command to display the CentOS version number. The cat/etc/osrelease or hostnamectl can be used to display detailed system information, including the OS version and name. If you have the lsb_release available, lsb_release-a will give a summary of your CentOS release. It may be necessary to install it separately. These methods are compatible with CentOS 7, 8, Stream 9, and even the newer CentOS Stream 10. They help you identify your system version quickly for troubleshooting purposes or software compatibility.
Leave feedback about this