CentOS中-bash: lsb_release: command not found错误的解决方法
大步's Blog 发布时间:2015-06-29 16:09:26 作者:佚名 我要评论
这篇文章主要介绍了CentOS中-bash: lsb_release: command not found错误的解决方法,同样适用于RedHat系的其他Linux系统,需要的朋友可以参考下
lsb_release可以查看系统工具,但是很多系统都没装这个命令。其实我也不建议用
lsb_release 来查看系统版本,因为有更好的方法。之所以我不推荐,是有原因的,见下
面解决:-bash: lsb_release: command not found办法:
-bash: lsb_release: command not found 就是 lsb_release命令没有安装。所以我们用
yum命令安装下就行了。
先看看这个命令属于哪个软件包:
复制代码
代码如下:# yum provides */lsb_release</p>
<p>[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</p> <p>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</p> <p>dkms-2.2.0.3-26.el6.noarch : Dynamic Kernel Module Support Framework
Repo : installed
Matched from:
Filename : /usr/lib/dkms/lsb_release</p> <p>redhat-lsb-core-4.0-7.el6.centos.i686 : LSB base libraries support for CentOS
Repo : installed
Matched from:
Filename : /usr/bin/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</p> <p>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</p> <p>dkms-2.2.0.3-26.el6.noarch : Dynamic Kernel Module Support Framework
Repo : installed
Matched from:
Filename : /usr/lib/dkms/lsb_release</p> <p>redhat-lsb-core-4.0-7.el6.centos.i686 : LSB base libraries support for CentOS
Repo : installed
Matched from:
Filename : /usr/bin/lsb_release
可以看出,属于redhat-lsb这个包,那么接着使用yum安装这个包:
复制代码
代码如下:# yum install -y redhat-lsb
截取一部分运行结果
复制代码
代码如下:……</p>
<p>(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
(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</p>
<p>Release: 6.5
其他用法,可自己使用 “-h” 自行查阅。
相关文章
- 在开机的时候,突然出现了GRUB引导错误,导致系统进入不了,解决方法就是使用CentOS安装光盘进行开机GRUB引导修复,下文提供了详细的演示步骤2015-01-26
CentOS yum 段错误 (core dumped)解决方法
这篇文章主要介绍了CentOS yum 段错误 (core dumped)解决方法,本文给出了两个解决方法,需要的朋友可以参考下2014-08-22- 在CentOS 6.2上再次做个练习,#echo "12345" > /etc/passwd 把/etc/passwd里的内容干掉,结果当然是进不了系统,此类情况我所想到的就是使用单用户模式修复了2012-10-15
最新评论