Knowing exactly the version of our CentOS operating system is necessary for tasks such as:
- Download the correct versions of updates
Normally we use our CentOS system to install hundreds of applications, but we do not have the exact certainty of which version we use , it is for this reason that TechnoWikis will explain some useful ways to know in detail the version of CentOS 7 and thus save this information for any administrative task .
1. Check the Linux kernel version in CentOS
This is the first step to take, it is necessary to know the version of the kernel or kernel, for this, we can execute any of the following commands:
join me join me (Print all system information)
2. Check the CentOS version
This same process applies to RedHat, and it is ideal to know that CentOS release version numbers are composed of two parts:
- A main version like "6" or "7"
- A minor or update version, such as "or 6.x" or "7.x".
To understand this a little more, for example, the CentOS 7.5 distribution has been built from the source packages of RHEL 7 update 5 which is known as the "point launch" of RHEL 7.
Check the CentOS version using RPM
The RPM (Red Hat Package Manager) command has been developed as a package management utility for Red Hat-based systems, such as CentOS or Fedora), so that with the rpm command, we will have the release version of CentOS, To do this we execute the following:
rpm --query centos-release (CentOS)
rpm --query redhat-release (RHEL)
Check the version using Hostnamectl
The hostnamectl command allows us to query and set the host name for Linux systems and to display other information related to the system itself, such as the release version of the operating system, to access this information we execute the following:
hostnamectl
Check the version using lsb_release
The lsb_release command is intended to display information from LSB (Linux Standard Base) and other distribution information. In CentOS / RHEL 7, the lsb_release command is provided in the redhat-lsb package, which we must install by running the following:
sudo yum install redhat-lsb
Once the package download is installed, we proceed to check the version information by executing the following:
lsb_release -d
Check version using Release Distro files
The above commands are responsible for retrieving information from the operating system version by taking several files from the operating system, it will be possible to view the contents of these files directly by using the cat command like this:
cat / etc / centos-release (CentOS] cat / etc / redhat-release (RHEL) cat / etc / system-release cat / etc / os-release (Contains more information)
With any of these options it will be possible to obtain the accurate version information in CentOS 7..