安装lsb_release
lsb_release命令用来查看当前系统的发行版信息(prints certain LSB (Linux Standard Base) and Distribution information.)。有了这个命令就可以清楚的知道到底是RedHat的、还是别的发行版,还有具体的版本号,比如3.4还是5.4等等。有些系统上不一定安装了这个命令,可以通过查看/etc/issue文件得到发行版信息。
例如
[root@localhost ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
但是如果没有这个的话,直接通过命令行yum install lsb_release安装的结果是这样的:
[root@localhost bin]# yum install lsb_release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: centos.ustc.edu.cn
No package lsb_release available.
Error: Nothing to do
自己安装的经历,找了好多博客,最后这样成功了:
1.查找哪个源包含这个命令
[root@localhost ~]# yum provides */lsb_release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: centos.ustc.edu.cn
base/7/x86_64/filelists_db | 6.7 MB 00:00:04
extras/7/x86_64/filelists_db | 528 kB 00:00:00
updates/7/x86_64/filelists_db | 3.0 MB 00:00:07
redhat-lsb-core-4.1-27.el7.centos.1.i686 : LSB Core module support
Repo : base
Matched from:
Filename : /usr/bin/lsb_release
redhat-lsb-core-4.1-27.el7.centos.1.x86_64 : LSB Core module support
Repo : base
Matched from:
Filename : /usr/bin/lsb_release
2.从上面的输出可以看到redhat-lsb-core-4.1-27.el7.centos.1.x86_64 这个package包含这个命令,那就安装这个包。
[root@localhost ~]# yum install redhat-lsb-core-4.1-27.el7.centos.1.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1 will be installed
--> Processing Dependency: redhat-lsb-submod-security(x86-64) = 4.1-27.el7.centos.1 for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--> Processing Dependency: spax for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--> Processing Dependency: /usr/bin/m4 for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--> Running transaction check
---> Package m4.x86_64 0:1.4.16-10.el7 will be installed
---> Package redhat-lsb-submod-security.x86_64 0:4.1-27.el7.centos.1 will be installed
---> Package spax.x86_64 0:1.5.2-13.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================
Package Arch Version Repository
Size
===================================================================================
Installing:
redhat-lsb-core x86_64 4.1-27.el7.centos.1 base 38 k
Installing for dependencies:
m4 x86_64 1.4.16-10.el7 base 256 k
redhat-lsb-submod-security x86_64 4.1-27.el7.centos.1 base 15 k
spax x86_64 1.5.2-13.el7 base 260 k
Transaction Summary
===================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 569 k
Installed size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): spax-1.5.2-13.el7.x86_64.rpm | 260 kB 00:00:00
(2/4): redhat-lsb-core-4.1-27.el7.centos.1.x86_64.rpm | 38 kB 00:00:00
(3/4): redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_6 | 15 kB 00:00:00
(4/4): m4-1.4.16-10.el7.x86_64.rpm | 256 kB 00:00:02
-----------------------------------------------------------------------------------
Total 265 kB/s | 569 kB 00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : spax-1.5.2-13.el7.x86_64 1/4
Installing : redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64 2/4
Installing : m4-1.4.16-10.el7.x86_64 3/4
Installing : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 4/4
Verifying : m4-1.4.16-10.el7.x86_64 1/4
Verifying : redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64 2/4
Verifying : spax-1.5.2-13.el7.x86_64 3/4
Verifying : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 4/4
Installed:
redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1
Dependency Installed:
m4.x86_64 0:1.4.16-10.el7
redhat-lsb-submod-security.x86_64 0:4.1-27.el7.centos.1
spax.x86_64 0:1.5.2-13.el7
Complete!
3 验证命令
[root@localhost ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
安装lsb_release的更多相关文章
- Centos6.5离线安装lsb_release
参考 http://www.linuxfromscratch.org/blfs/view/systemd/postlfs/lsb-release.html首先在其他电脑下载lsb_release源码地 ...
- HOSTNAME问题 和yum配置163源的操作 安装lsb_release,KSH,CSH
HOSTNAME 在 /etc/hosts 里添加一行 127.0.0.1 yourhostname yum配置 来自http://www.cnblogs.com/wutengbiao/p/41889 ...
- lsb_release 提示命令不存在
1. 报错信息 bash: lsb_release: command not found 2. 问题原因 未安装 lsb_release 命令 3. 解决方法 用 yum 命令安装 lsb_relea ...
- Centos里没有lsb_release
查看Centos操作系统版本,输入指令 lsb_release -a 报无此命令 解决办法,安装lsb_release 1.执行指令:yum install -y redhat-lsb 2.安装完毕后 ...
- Linux命令——lsb_release
简介 LSB是Linux Standard Base(Linux标准库)的缩写, lsb_release命令 用来与具体Linux发行版相关的Linux标准库信息. 注:LSB的译法有Linux标准库 ...
- OpenVINO在linux下安装
一.准备安装环境: 1.带命令行的64位centos操作系统,推荐极简安装模式,先不要安装GNOME桌面,避免和后面的openvino环境冲突 2.cpu要求 我目前是在服务器的虚拟机里面安装 注意如 ...
- VMware 虚拟机图文安装和配置 AlmaLinux OS 8.6 教程
前言: 这是<VMware 虚拟机图文安装和配置 Rocky Linux 8.5 教程>一文的姐妹篇教程,如果你需要阅读它,请点击这里. 2020 年,CentOS 宣布:计划未来将重心从 ...
- VMware 虚拟机图文安装和配置 Rocky Linux 8.5 教程
前言 2020 年,CentOS 宣布:计划未来将重心从 CentOS Linux 转移到 CentOS Stream.CentOS 8 的生命周期已于 2021 年 12 月 31 日终止,而 Ce ...
- CentOS 添加常用 yum 源
CentOS 的官方源去掉了一些与版权有关的软件,因此想要安装这些软件或者手动下载安装,或者使用其他源. 下面我推荐常用的两个源, 这两个源基本可以满足一般服务器的使用需求. 首先, 添加源之前要确定 ...
随机推荐
- java_web连接SQL_server详细步骤
(1).我用的是Myeclipse,可以直接将sqljdbc4.jar拷到项目文件 (2).点开SQL Server配置管理器 选中SQL Server2008网络配置下的SQLEXPRESS的协议, ...
- Python网络爬虫(1)--url访问及参数设置
环境:Python2.7.9 / Sublime Text 2 / Chrome 1.url访问,直接调用urllib库函数即可 import urllib2 url='http://www.baid ...
- dstat 监控时,无颜色显示
linux:Centos 6.6 dstat:0.7.0 注意,有这个提醒:Color support is disabled, python-curses is not installed good ...
- IPV4和IPV6的区别
一.扩展了路由和寻址的能力 IPv6 把 IP 地址由 32 位增加到 128 位,从而能够支持更大的地址空间,估计在地球表面每平米有 4*10^18 个 IPv6 地址,使 IP 地址在可预见的将来 ...
- java super
用法: 1.子类构造器里面默认调用父类构造器 2.调用父类的属性,方法
- P3216 [HNOI2011]数学作业
题目描述 小 C 数学成绩优异,于是老师给小 C 留了一道非常难的数学作业题: 给定正整数 N 和 M ,要求计算Concatenate (1 .. N) Mod M 的值,其中 Concatenat ...
- Musical Theme POJ - 1743(后缀数组+二分)
求不可重叠最长重复子串 对于height[i]定义为sa[i]和 sa[i-1]的最长公共前缀 这个最长公共前缀的值肯定是最大的 证明: 设rank[j] < rank[k], 则不难证明后缀j ...
- VSS2005 上传pdf 空白
加补丁 VS80-KB943847-X86-INTL.exe
- MT【138】对称乎?
已知\(a+b=1\),求\((a^3+1)(b^3+1)\)的最大值______ : 解答: \[ \begin{align*} (a^3+1)(b^3+1) &=a^3+b^3+a^3+b ...
- [AT2567] [arc074_c] RGB Sequence
题目链接 AtCoder:https://arc074.contest.atcoder.jp/tasks/arc074_c 洛谷:https://www.luogu.org/problemnew/sh ...