解决-bash: lsb_release: command not found

今天想判断系统版本,没想到没有lsb_release,lsb_release是查看系统版本信息的工具.当然我们也可以用其他的命令来解决,但这个问题还是解决掉.


  系统:centos 6.4
1.先检查有没有lsb_release
[root@test ~]# lsb_release -r
-bash: lsb_release: command not found

2.使用yum安装lsb
[root@localhost ~]#yum install -y redhat-lsb

3.验证lsb是否已经安装上了
[root@localhost ~]# lsb_release -r
Release: 6.4

可以看到已经成功安装上了lsb了.

[root@localhost ~]# 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.4 (Final)
Release: 6.4
Codename: Final

原文地址:https://www.cnblogs.com/yangxia-test/p/4330584.html