Introduction
Red Hat is a popular and influential fork of the Linux operating system. It has been around since the mid-1990s and has earned a reputation for being stable, reliable, and regularly updated. There are many Linux operating systems based on Red Hat architecture, such as RHEL, CentOS and Fedora.
Finding your Red Hat version is straightforward. This tutorial shows you five ways to check the version of Red Hat Enterprise Linux (RHEL).
Prerequisites
- A system running RHEL, CentOS, or another Red-Hat-based Linux distribution
- A terminal window/command line (Ctrl-Alt-F2)
5 Ways to Find Version of Red Hat Linux (RHEL)
Option 1: Use hostnamectl
The hostnamectl
command is usually used to track the way your system appears on a network. However, it also includes information such as the OS and version, making it a quick and handy way to check these specifics.
Open a terminal window and enter the following:
hostnamectl
The fields you are interested in are:
- Operating System: This tells you which Linux fork you are 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 are running a 32-bit or 64-bit operating system, which is essential when choosing a software package to install.
Option 2: Find Version in /etc/redhat-release File
Red Hat-based distros contain release files located in the /etc/redhat-release directory.
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
In the image above, you can see that this system is using the version CentOS 7.6.1810.
Option 3: Check Query Release Package with RPM
Alternatively, you can use the rpm
command to query Red Hat’s release package.
In this operation, rpm stands for Red Hat Package manager.
Enter the following command:
rpm ––query centos-release
OR
rpm ––query redhat-release
Specifically, use the command that is appropriate for your version of Linux (RHEL or CentOS distribution).
Expect more details than when using hostnamectl
.
Option 4: 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
Option 5: Check 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 file names of release versions by typing the following command:
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
At the moment, RHEL (Red Hat Enterprise Linux), and CentOS are two of the most popular versions of Red Hat Linux.
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 10.” The number following the dot 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
After reading this article, you will know how to check or find your Red Hat operating system version in a number of ways.
Finally, for more information about the Red Hat family of Linux, please see the official Red Hat documentation.
原创文章,作者:1402239773,如若转载,请注明出处:https://blog.ytso.com/223784.html