Introduction

Red Hat is a popular and influential fork of the Linux operating system. It’s been around since the mid-1990s and earned a reputation for being stable, reliable, and regularly updated. There are many Linux operating systems based on Red Hat architecture, (RHELCentOS and Fedora).

Finding your Red Hat version is simple. This tutorial shows you 5 ways to check the system version of your Red Hat Enterprise Linux (RHEL).

Prerequisites

  • A system running RHEL, CentOS, or another Red-Hat-based Linux distribution

Tools/Software

  • A terminal window/command line (Ctrl-Alt-F2)

5 Ways to Find Version of Red Hat Linux (RHEL)

Use hostnamectl

The hostnamectl command is usually used to track the way your system appears on a network. But it also includes the OS and version and makes a quick and handy way to check the OS version.

Open a terminal window and enter the following: hostnamectl

The fields you’re interested in are:

  • Operating System: This tells you which Linux fork you’re using, and which major release.
  • Kernel: This is the version of the Linux kernel your operating system is using.
  • Architecture: This tells you whether you’re running a 32-bit or 64-bit operating system, which is essential when choosing a software package to install.

Find Version in /etc/redhat-release file

Red Hat-based distros contain release files located in: /etc/redhat-release

For example, os-release, system-release, and redhat-release.

To check each file for your Red Hat OS version use the command: cat /etc/redhat-release

[root@alpha ~]# cat /etc/redhat-release Red Hat Enterprise
Linux Server release 5.10 (Tikanga)

This output displays the server is running RHEL version 5 Release 10.

Check Query Release Package With RPM

You can use the RPM command to query Red Hat’s release package.

For this operation, rpm stands for Red Hat Package manager.

Enter the following: rpm ––query centos-release  OR

rpm ––query redhat-release

Use the command that’s appropriate for your version of Linux (RHEL or CentOS).

Note: This command displays more details than hostnamectl.

Finding Red Hat version and release using /etc/issue file

You can check the Red Hat version within the /etc/issue file.

Use the command: cat /etc/issue

Common Platform Enumeration File

Check the CPE file for your Red Hat version by entering: cat /etc/system-release-cpe

The system should return a full name and version of your operating system.

Check Other Release Files

Your Linux operating system keeps a set of release files in the /etc/ directory.

List the filenames of release versions by entering: ls /etc/*release

Each of the entries listed holds information about your Red Hat version.

Use the cat (concatenate) command to list the contents of the files: cat /etc/redhat-release

You can substitute the names of the files displayed on your system for the redhat-release file in the example above.

Discussion on Red Hat Versions

Currently, two of the most popular versions of Red Hat Linux are RHEL (Red Hat Enterprise Linux), and CentOS.

The Red Hat version is different from the Linux Kernel version – the Linux Kernel is like the central brain of the Linux operating system and can be updated independently of the operating system. The Operating System version is the release version number of the whole OS package.

You may see a Red Hat version number like Red Hat 7.3. The number 7 refers to a major release, much like “Windows 7” and “Windows 8.” The number following the dot usually refers to the level of patches and minor updates. So Red Hat 7.3 is Red Hat version 7, patched and updated to 7.3.

Conclusion

Now you know how to check or find your Red Hat operating system version.

For more information about the Red Hat family of Linux, please see the official Red Hat documentation.