命令:lsb_release -a
-a, --all
显示所有信息
除此之外其他参数还有:
-v, --version
显示版本信息
-i, --id
显示发行版的 ID
-d, --description
显示该发行版的描述信息
-r, --release
显示当前系统是发行版的具体版本号
-c, --codename
发行版代号
-h, --help
显示帮助信息
如果运行提示command not found的话,使用yum install 安装,
但是不要直接yum install lsb_release,会出现如下错误提示:
[root@localhost ~]# yum install lsb_release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.neusoft.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
No package lsb_release available.
Error: Nothing to do
正确的安装命令应该是yum install redhat-lsb -y
其中最后-y表示yes直接安装,不会出现安装提示,想看提示信息 的话不要加-y
安装成功后运行,题主版本如下:
[root@localhost ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core