解決:-bash: lsb_release: command not found辦法

lsb_release能夠查看系統工具,可是不少系統都沒裝這個命令。其實我也不建議用
lsb_release 來查看系統版本,由於有更好的方法。之因此我不推薦,是有緣由的,見下
面解決:-bash: lsb_release: command not found辦法: git

-bash: lsb_release: command not found 就是 lsb_release命令沒有安裝。因此咱們用
yum命令安裝下就好了。 centos

先看看這個命令屬於哪一個軟件包: bash

# yum provides */lsb_release ide

[root@ksharpdabu ~]#  yum provides */lsb_release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.psychz.net
* epel: mirrors.solfo.com
* extras: mirror.san.fastserv.com
* updates: mirror.lax.hugeserver.com
base/filelists_db                                                       | 5.1 MB     00:00
epel/filelists_db                                                       | 7.8 MB     00:00
extras/filelists_db                                                     |  31 kB     00:00
updates/filelists_db                                                    | 614 kB     00:00
vz-base/filelists                                                       |  825 B     00:00
vz-updates/filelists                                                    | 3.0 kB     00:00
redhat-lsb-core-4.0-7.el6.centos.i686 : LSB base libraries support for CentOS
Repo        : base
Matched from:
Filename    : /usr/bin/lsb_release 工具

dkms-2.2.0.3-28.git.7c3e7c5.el6.noarch : Dynamic Kernel Module Support Framework
Repo        : epel
Matched from:
Filename    : /usr/lib/dkms/lsb_release .net

dkms-2.2.0.3-26.el6.noarch : Dynamic Kernel Module Support Framework
Repo        : installed
Matched from:
Filename    : /usr/lib/dkms/lsb_release server

redhat-lsb-core-4.0-7.el6.centos.i686 : LSB base libraries support for CentOS
Repo        : installed
Matched from:
Filename    : /usr/bin/lsb_release xml

能夠看出,屬於redhat-lsb這個包,那麼接着使用yum安裝這個包: get

# yum install  -y  redhat-lsb it

截取一部分運行結果

……

(71/77): redhat-lsb-compat-4.0-7.el6.centos.i686.rpm                    |  10 kB     00:00
(72/77): redhat-lsb-core-4.0-7.el6.centos.i686.rpm                      |  25 kB     00:00
(73/77): redhat-lsb-graphics-4.0-7.el6.centos.i686.rpm                  |  12 kB     00:00
(74/77): redhat-lsb-printing-4.0-7.el6.centos.i686.rpm                  |  11 kB     00:00
(75/77): urw-fonts-2.4-10.el6.noarch.rpm                                | 3.1 MB     00:00
(76/77): xml-common-0.6.3-33.el6.noarch.rpm                             |  18 kB     00:00
(77/77): xorg-x11-font-utils-7.2-11.el6.i686.rpm                        |  73 kB     00:00
———————————————————————————————–
Total                9.3 MB/s | 104 MB     00:11

能夠看到,爲了裝個lsb_release ,就還要裝104M的其餘依賴包之類的。這就是我不推薦這個命令查系統的緣由。

而後,就能夠使用lsb_release 查看系統版本了;
# lsb_release  -r

Release:    6.5

其餘用法,可本身使用 「-h」 自行查閱。

相關文章
相關標籤/搜索