3 Ways To Check Your System Linux Version On CentOS 7/RHEL 7
CentOS 7 /RHEL 7 operating system has been released and if you know something about this version of CentOS 7 or RHEL 7, it changed a lot . How do I to check Centos system version? How to get the version information of RHEL system? In this post, you’ll see three ways to get the system version infromation.
Get The CentOS /RHEL System Version Information
1. you can view the /etc/issue files to see what version is for current system. Using “cat” command to view this file.
[root@osetc~]# cat /etc/issue CentOS release 6.9 (Final) Kernel \r on an \m
Form the output of that command, you can see that CentOS version is 6.9
This way is not apply to CentOS 7/RHEL 7 system, As you won’t get any useful information from the output of that command. Maybe its a CentOS 7 or RHEL 7’s bug.
[root@osetc~]# cat /etc/issue \S Kernel \r on an \m
2. check the /etc/redhat-release
this way suit all CentOS or RHEL version to check these version information.
[root@osetc~]# cat /etc/redhat-release CentOS release 6.3 (Final)
3. You can also run “lsb_release” command with “-a” option. the first step of running this command is that you need to check if “redhat-lsb-core” package was installed in your system. if not, installed it using the following command.
$sudo rpm -qa | grep lsb-core $ rpm -ivh redhat-lsb-core-4.0-7.el6.x86_64.rpm
or
$yum install redhat-lsb-core
[root@osetc~]# lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 6.5 (Santiago) Release: 6.5 Codename: Santiago
For CentOS 7 /RHEL 7 system, there is anoter way to check its version info, it’s checking /etc/os-release file. see below:
[root@osetc~]# cat /etc/os-release NAME="Red Hat Enterprise Linux Server" VERSION="7.0 (Maipo)" ID="rhel" ID_LIKE="fedora" VERSION_ID="7.0" PRETTY_NAME="Red Hat Enterprise Linux Server 7.0 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.0:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.0 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION=7.0