How to check version in centos

Release: 2020-03-18 17:06:03
Original
9444 people have browsed it

How to check version in centos

How to check the centos system version:

Recommended: "centos usage tutorial"

1. Use lsb_release -a Command view

[root@centos6 ~]# 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:    CentOS
Description:    CentOS release 6.9 (Final)
Release:    6.9
Codename:    Final
Copy after login

However, there is no lsb_release command in centos7.3.

2. Use the cat /etc/os-release command to open the file and view it

[root@centos7 app]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
Copy after login

3. Use the cat /etc/redhat-release (/etc/centos-release) command to view it

[root@centos6 ~]# cat /etc/redhat-release 
CentOS release 6.9 (Final)
[root@centos7 app]# cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)
Copy after login

4. Use the rpm -q centos-release command to view

[root@centos6 ~]# rpm -q centos-release
centos-release-6-9.el6.12.3.x86_64
[root@centos7 app]# rpm -q centos-release
centos-release-7-3.1611.el7.centos.x86_64
Copy after login

Recommended learning

Linux video tutorial://m.sbmmt.com/ course/list/33.html

The above is the detailed content of How to check version in centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!