Do you know the version of CentOS/RHEL release you are running on your server? Why is this even important? There are several reasons to keep this information in mind: to quickly gather information about your system; keep up with bug fixes and security updates, and configure correct software repositories for a specific release, among others.

This is probably an easy task for experienced users, but it’s not usually the case for newbies. In this article, we will show how to check the version of CentOS or RHEL Linux installed on your server.

How to Check Linux Kernel Version in CentOS

Knowing the kernel version is just as important as knowing the distro release version. To check Linux kernel version, you can use the uname command.

$ uname -or
$ uname -a #print all system information
Check Kernel Version in CentOS

Check Kernel Version in CentOS

From the output of the above command, the CentOS is powered by an old kernel version, to install or upgrade to the latest kernel release, follow the instructions in our article: How to Install or Upgrade to Kernel 4.15 in CentOS 7.

How to Check CentOS or RHEL Release Version

CentOS release version numbers have two parts, a major version such as “6” or “7” and a minor or update version, such as or “6.x” or “7.x”, which correspond to the major version and update set of RHEL receptively, used to build a particular CentOS release.

To elaborate more in this, take for instance CentOS 7.5 is built from the source packages of RHEL 7 update 5 (also known as RHEL version 7.5), which is referred to as a “point release” of RHEL 7.

Let’s take a look at these 4 useful ways to check CentOS or RHEL release version.

1. Using RPM Command

RPM (Red Hat Package Manager) is a popular and core package management utility for Red Hat based systems like (RHEL, CentOS and Fedora), using this rpm command, you will get your CentOS/REHL release version.

$ rpm --query centos-release [On CentOS]
$ rpm --query redhat-release [On RHEL]
Check CentOS Version Using RPM Command

Check CentOS Version Using RPM Command

2. Using Hostnamectl Command

hostnamectl command is used to query and set Linux system hostname, and show other system related information, such as operating system release version as shown in the screenshot.

$ hostnamectl
Check CentOS Version Using hostnamectl Command

Check CentOS Version Using hostnamectl Command

3. Using lsb_release Command

lsb_release command displays some LSB (Linux Standard Base) and distribution information. On CentOS/REHL 7, the lsb_release command is provided in the redhat-lsb package which you can install it.

$ sudo yum install redhat-lsb

Once you have installed it, you can check your CentOS/REHL version as shown.

$ lsb_release -d
Show CentOS Version

Show CentOS Version

4. Using Distro Release Files

All the above commands retrieve OS release information from a number of system files. You can view the contents of these files directly, using the cat command.

$ cat /etc/centos-release [On CentOS]
$ cat /etc/redhat-release [On RHEL]
$ cat /etc/system-release
$ cat /etc/os-release #contains more information
Check CentOS Release Version

Check CentOS Release Version

That’s all for now! If you know any other method that should be covered here, let us know via the comment form below. You can also ask any questions related to the topic.

Facebook Comments

More Stuff

Latest Firefox Release is Faster than Ever With the introduction of the new Firefox Quantum browser in 2017 we changed the look, feel, and performance of our core product. Since then we have la...
Competing without a Marketing Budget: When All You Have is a Produ... This is a story about the power of a good landing page, PR efforts, and marketing strategy. The refreshing twist here is that instead of explaining ho...
The Ongoing Fiasco and Mysterious Afterlife of QuadrigaCX I’d say you were a little late to the cryptocurrency party if you haven’t heard about the ongoing catastrophe that’s been QuadrigaCX these past six ...
We are leaving older adults out of the digital world Jessica Fields Contributor Share on Twitter Jessica Fields is a research analyst and program manager at the UCSF Center for Vulnerable Populat...
Spread the love

Posted by News Monkey