Introduction
An operating system version refers to the release number of the main OS package. Red Hat's full-number releases are major versions with new features and functionalities, followed by point releases that provide feature and security updates.
Learn five simple ways to check the Red Hat version installed on your system.
Prerequisites
- A system running RHEL or another Red-Hat-based Linux distribution.
- Command-line access.
How to Check Red Hat Linux (RHEL) Version
The installed version of Red Hat can be checked using the command line and GUI (if present on the server). The following sections introduce five methods to check the Red Hat version installed on the system.
Method 1: Use hostnamectl
The primary function of the hostnamectl
command is to track how the local system appears on a network. It also displays operating system information, including its version.
To see the system information, execute the command without any arguments:
hostnamectl
The operating system version can be found in the Operating System field.
Aside from the basic version information, the following fields offer more detail about the system:
- Kernel. The version of the Linux kernel the operating system uses.
- Architecture. Shows whether the system runs a 32-bit or 64-bit operating system, which is essential when choosing a software package to install.
Method 2: Find Version in Release File
Red Hat-based distributions store release files in the /etc directory.
List the names of release files by typing the following command:
ls /etc/*release
The output shows three files: os-release, redhat-release, and system-release.
To check each file for your Red Hat OS version, use the cat command:
cat /etc/redhat-release
The most detailed information can be found in the os-release file:
cat /etc/os-release
The OS version number is the value of the VERSION variable.
Method 3: Check Query Release Package with RPM
RPM is a package management system for RHEL and related distributions. Use the following rpm
command to query Red Hat's release package and find the OS version:
rpm ––query redhat-release
The version number appears as part of the release package name.
Method 4: Check Common Platform Enumeration File
Common Platform Enumeration (CPE) is a naming scheme based on generic syntax for Uniform Resource Identifiers (URI). Check the CPE file for your Red Hat version by entering the following command:
cat /etc/system-release-cpe
The system returns a full name and version of the operating system.
Method 5: Check Red Hat Version Using GUI
If the local RHEL server has GUI installed, users can check the OS version in the Settings app:
1. Open Settings.
2. Select the About section in the menu on the left side.
3. Scroll to the OS Name field in the About section. The name includes the current OS version number.
Conclusion
After reading this article, you know how to check the Red Hat version on your machine. The article included four CLI and one GUI method for checking the operating system version.
If you are looking for a free RHEL-based distribution ready for production, read What Rocky Linux Is and Why You Should Use It.