To check the Red Hat Enterprise Linux (RHEL) version, you can use simple command-line tools. The most common method is to run cat /etc/redhat-release or cat /etc/os-release, which will display the exact RHEL version and release details. You can also use the hostnamectl command to get additional system information, including the operating system version, kernel, and architecture.
Why It’s Important to Know Your RHEL Version
Before diving into the steps, it’s important to understand why knowing your RHEL version is essential. Here are some reasons:
- Compatibility: Applications, services, and third-party software often have specific version requirements for RHEL. Knowing your version helps ensure compatibility when installing new software.
- Updates and Patches: Each version of RHEL has different support lifecycles and update schedules. Knowing your version allows you to check for the latest updates and security patches.
- Troubleshooting: System administrators and support teams often ask for the exact version of RHEL when diagnosing problems or providing solutions. This This detail is vital for accurate troubleshooting is vital for accurate troubleshooting.
- Compliance: In enterprise environments, compliance regulations may require specific operating system versions to be in place.
Now, let’s explore How to Check Red Hat Enterprise Linux Version?
Method-1: Using the /etc/redhat-release File
The easiest and most common way to check the version of Red Hat Enterprise Linux is by using the /etc/redhat-release file. This file contains a single line of text that shows the version number and release information.
Steps:
- Open the terminal.
- Run the following command:
bash Copy code cat /etc/redhat-release - You should see output similar to this:
arduino Copy code Red Hat Enterprise Linux Server release 8.4 (Ootpa)
In this example, the version is 8.4, and “Ootpa” is the codename for the release. This file is present in all RHEL systems and provides a quick and straightforward way to check the version.
Additional Notes:
- If you’re using a derived distribution like CentOS or Oracle Linux, the file may display a different name, but the method is still applicable.
Method-2: Using the hostnamectl Command
The hostnamectl command is used to query and change the hostname & related settings. It also provides information about the operating system version, kernel, and architecture.
Steps:
- Open the terminal.
- Run the following command:
bash Copy code hostnamectl - The output should look like this:
yaml Copy code Static hostname: rhel-server Icon name: computer-vm Chassis: vm Machine ID: a4f4b798f5404e4a93712f41c003132b Boot ID: d94ef09f073b4b7d8c08f44527f0c6e5 Virtualization: kvm Operating System: Red Hat Enterprise Linux 8.4 (Ootpa) Kernel: Linux 4.18.0-240.22.1.el8_3.x86_64 Architecture: x86-64
Here, the Operating System line reveals the version, which in this case is Red Hat Enterprise Linux 8.4. The kernel version and system architecture are also displayed, which can be useful for system diagnostics.
Method-3: Using the /etc/os-release File
The /etc/os-release file is a standard file found in most Linux distributions that contains identification data about the operating system, including the name and version.
Steps:
- Open the terminal.
- Run the following command:
bash Copy code cat /etc/os-release - You should see an output similar to the seeing:
makefile Copy code NAME="Red Hat Enterprise Linux" VERSION="8.4 (Ootpa)" ID="rhel" ID_LIKE="fedora" VERSION_ID="8.4" PLATFORM_ID="platform:el8" PRETTY_NAME="Red Hat Enterprise Linux 8.4 (Ootpa)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.4"
In this case, the PRETTY_NAME field provides the full name and version, which is Red Hat Enterprise Linux 8.4 (Ootpa).
Why Use This Method?
This method is useful because the /etc/os-release file is part of the os-release standard across multiple Linux distributions, making it a reliable way to check the OS version regardless of the specific Linux flavor.
Method-4: Using the lsb_release Command
The lsb_release command is part of the Linux Standard Base (LSB) and provides information about the distribution. However, it’s important to note that this command may not be available by default on all RHEL systems. You may need to install the redhat-lsb-core package first.
Steps:
- Open the terminal.
- If the command isn’t available, install it using the following command:
bash Copy code sudo yum install redhat-lsb-core - After installation, run the following command:
bash Copy code lsb_release -a - The output will look like this:
yaml Copy code LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 8.4 (Ootpa) Release: 8.4 Codename: Ootpa
This method provides similar information to the /etc/redhat-release file but in a slightly different format.
Method-5: Using the rpm Command to Check the Release Package
Another method is to check the installed release package using the rpm command. The Red Hat release package contains version information and can be queried easily.
Steps:
- Open the terminal.
- Run the following command:
bash Copy code rpm -q redhat-release - The output will be something like:
arduino Copy code redhat-release-8.4-1.el8.x86_64
The version information is embedded in the package name (8.4 in this case). This method is helpful if you’re already familiar with the rpm package manager.
Method-6: Checking Version via Graphical Interface
For those who prefer using a graphical interface, Red Hat provides a way to check the system version through the Settings menu in the GUI.
Steps:
- Open the Activities menu in the top-left corner of the screen.
- Search for Settings and open it.
- Scroll down and select Details.
- In the Details section, you will see the OS version listed under the Operating System heading.
This method is useful for users who are more comfortable with a graphical interface rather than the command line.
Conclusion
Knowing your Red Hat Enterprise Linux (RHEL) version is essential for system management, software installation, and troubleshooting. Whether you prefer the command line or a graphical interface, several methods are available to check your RHEL version.
To summarize, here are the most common ways to check your RHEL version:
- /etc/redhat-release file for a quick look.
- hostnamectl to gather system and version information.
- /etc/os-release file for a standardized method across Linux distributions.
- lsb_release -a for more detailed distribution information.
- rpm -q redhat-release to query the release package.
With these methods, you can quickly and easily identify your RHEL version and ensure your system is up to date and compatible with any required applications or services. Whether you’re a system administrator, developer, or casual user, these commands will prove useful in your day-to-day interactions with Red Hat Enterprise Linux.



