安装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 的官方源去掉了一些与版权有关的软件,因此想要安装这些软件或者手动下载安装,或者使用其他源. 下面我推荐常用的两个源, 这两个源基本可以满足一般服务器的使用需求. 首先, 添加源之前要确定 ...
随机推荐
- Leetcode题库——17.电话号码的字母组合
@author: ZZQ @software: PyCharm @file: letterCombinations.py @time: 2018/10/18 18:33 要求:给定一个仅包含数字 2- ...
- Teamwork(The first day of the team)
今天是第一次的小组讨论,我们主要是分析了我们的大概方向及大概功能及相应的分工.其实具体也还没有确定下来,只是大概的说了一下,确定了master为杨灵超同学.下面用图片记录我们这一天的工作内容(杨灵超V ...
- 团队作业4--第一次项目冲刺2(Alpha版本)
1.会议 第二次会议: ①:总结第一天任务出现的问题 ②:安排下面两天的任务 2任务安排 3.任务分解图 4.燃尽图 5.适当的项目程序/模块的最新(运行)截图 6.心得 因为做前端的同学并不擅长这方 ...
- 如何在Sql Server 2000中用一条语句实现树的查询
以公司的网站栏目表为例,表结构(表名:Subject)如下: 字段名称 字段类型 字段长度 id int 4 NAME varchar 200 PARENTID int 4 CODE varcha ...
- 11git更改提交
.将不必要的文件add .上次提交觉得是错的 .不想改变暂存区内容,只是想调整提交的信息 .版本回滚 git reset HEAD 文件名 移除不必要的添加到暂存区的文件 git reset HEAD ...
- SpringBoot(十三)_springboot上传Excel并读取excel中的数据
今天工作中,发现同事在整理数据,通过excel上传到数据库.所以现在写了篇利用springboot读取excel中的数据的demo.至于数据的进一步处理,大家肯定有不同的应用场景,自行修改 pom文件 ...
- BZOJ5286 HNOI/AHOI2018转盘(分块/线段树)
显然最优走法是先一直停在初始位置然后一次性走完一圈.将序列倍长后,相当于找一个长度为n的区间[l,l+n),使其中ti+l+n-1-i的最大值最小.容易发现ti-i>ti+n-(i+n),所以也 ...
- Virtual Table
C++对象模型——吴泰 C/C++杂记 C++中的虚函数(表)实现机制以及用C语言对其进行的模拟实现 C++ 多继承和虚继承的内存布局 [已翻译100%] (虚继承参考,推荐) 图说C++对象模型:对 ...
- Udp广播的发送和接收(iOS + AsyncUdpSocket)下篇
接上篇C#的Udp广播的发送和接收 http://www.cnblogs.com/JimmyBright/p/4637090.html ios中使用AsyncUdpSocket处理Udp的消息非常方便 ...
- BZOJ5058 期望逆序对 【矩乘 + 组合数学 + 树状数组】
题目链接 BZOJ5058 题解 可以发现任意两个位置\(A,B\)最终位置关系的概率是相等的 如果数列是这样: CCCCACCCCBCCCC 那么最终有\(7\)种位置关系 \((A,B)\) \( ...