There are many ways to check the CentOS version. In this tutorial, we will learn how to check the CentOS version through eight different utilities.
有很多方法可以检查CentOS版本。 在本教程中,我们将学习如何通过八个不同的实用程序来检查CentOS版本。
检查CentOS版本的8种方法 (8 Ways to Check CentOS Version)
- /etc/centos-release file / etc / centos-release文件
- /etc/system-release file / etc / system-release文件
- /etc/os-release file / etc / os-release文件
- /etc/redhat-release file / etc / redhat-release文件
- lsb_release command lsb_release命令
- rpm query rpm查询
- rpm macro rpm宏
- hostnamectl command hostnamectl命令
CentOS版本号是什么意思? (What does CentOS Version Number Means?)
CentOS version have three parts.
CentOS版本包括三个部分。
- Major Version: Major release version number 主要版本:主要发行版本号
- Minor Version: Minor release version number 次要版本:次要发行版本号
- Monthstamp: codebase month and year timestamp Monthstamp:代码库的月份和年份时间戳
1. / etc / centos-release文件 (1. /etc/centos-release file)
The CentOS specific file, which contains the CentOS release and version details.
特定于CentOS的文件,其中包含CentOS发行版和版本详细信息。
[root@centos ~]# cat /etc/centos-release
CentOS Linux release 8.1.1911 (Core)
[root@centos ~]#
- Major Version: 8 主要版本:8
- Minor Version: 1