bash: cmake: command not found...+++++++lsb_release: command not found

一 .bash: cmake: command not found...

centos中安装那个cmake。

1、问题
powershell 复制代码
[root@PC3 home]# cmake
bash: cmake: command not found...
Similar command is: 'make'

当前系统:

powershell 复制代码
[root@PC3 home]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 7.0 (Maipo)
Release:        7.0
Codename:       Maipo
-----------------------------------
bash: cmake: command not found...

也可能会遇到 lsb_release: command not found

遇到此问题详见 二. bash: lsb_release: command not found错误的解决方法

2、安装cmake
powershell 复制代码
[root@PC3 home]# yum install cmake
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel7                                                                                                         | 4.1 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package cmake.x86_64 0:2.8.11-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
 Package                      Arch                          Version                               Repository                    Size
=====================================================================================================================================
Installing:
 cmake                        x86_64                        2.8.11-4.el7                          rhel7                        6.7 M

Transaction Summary
=====================================================================================================================================
Install  1 Package

Total download size: 6.7 M
Installed size: 25 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : cmake-2.8.11-4.el7.x86_64                                                                                         1/1
  Verifying  : cmake-2.8.11-4.el7.x86_64                                                                                         1/1

Installed:
  cmake.x86_64 0:2.8.11-4.el7

Complete!
-----------------------------------
bash: cmake: command not found...
3、测试效果
powershell 复制代码
[root@PC3 home]# cmake --version
cmake version 2.8.11
[root@PC3 home]# cmake | head
cmake version 2.8.11
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>

Options
  -C <initial-cache>          = Pre-load a script to populate the cache.
  -D <var>:<type>=<value>     = Create a cmake cache entry.
  -U <globbing_expr>          = Remove matching entries from CMake cache.
-----------------------------------
bash: cmake: command not found...

二. bash: lsb_release: command not found错误的解决方法

转载后的博文

powershell 复制代码
[root@localhost ~]# slb_release -a
bash: slb_release: command not found...

-bash: lsb_release: command not found 就是 lsb_release命令没有安装

通过搜索,找到下面文章,文章中说有更好的方法不推荐,

不推荐的原因:为了装个lsb_release ,就还要装104M的其他依赖包之类的。

先看看这个命令属于哪个软件包:yum provides */lsb_release

可以看出,属于redhat-lsb这个包,那么接着使用yum安装这个包:yum install -y redhat-lsb

powershell 复制代码
[root@localhost ~]# lsb_release  -r
Release:	7.9.2009
[root@localhost ~]# lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.9.2009 (Core)
Release:	7.9.2009
Codename:	Core

转载之原博文:CentOS中-bash: lsb_release: command not found错误的解决方法

这篇文章主要介绍了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命令安装下就行了。

先看看这个命令属于哪个软件包:

代码如下:

powershell 复制代码
# 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

可以看出,属于redhat-lsb这个包,那么接着使用yum安装这个包:

代码如下:

powershell 复制代码
# yum install -y redhat-lsb

截取一部分运行结果

代码如下:

powershell 复制代码
......</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

可以看到,为了装个lsb_release ,就还要装104M的其他依赖包之类的。这就是我不推荐这个命令查系统的原因。

然后,就可以使用lsb_release 查看系统版本了;

代码如下:

powershell 复制代码
# lsb_release -r</p> <p>Release: 6.5

其他用法,可自己使用 "-h" 自行查阅。


mb5fdcadbf25fde

bash: cmake: command not found...

静文·红·精灵

bash: lsb_release: command not found错误的解决方法

脚本之家

CentOS中-bash: lsb_release: command not found错误的解决方法

相关推荐
ErizJ13 分钟前
Golang | 迭代器模式
开发语言·golang·迭代器模式
牙痛不能吃糖,哭17 分钟前
C++面试复习日记(8)2025.4.25,malloc,free和new,delete的区别
开发语言·c++
突头小恐龙17 分钟前
Chrome devTools - Lighthouse
前端·javascript·chrome
健康的猪20 分钟前
golang的cgo的一点小心得
开发语言·后端·golang
夜夜敲码42 分钟前
C语言教程(十六): C 语言字符串详解
c语言·开发语言
宋康1 小时前
C语言结构体和union内存对齐
c语言·开发语言
居然是阿宋1 小时前
Kotlin高阶函数 vs Lambda表达式:关键区别与协作关系
android·开发语言·kotlin
Cao1234567893212 小时前
简易学生成绩管理系统(C语言)
c语言·开发语言
The Future is mine2 小时前
C# new Bitmap(32043, 32043, PixelFormat.Format32bppArgb)报错:参数无效,如何将图像分块化处理?
开发语言·c#
亿坊电商2 小时前
PHP框架在微服务迁移中能发挥什么作用?
开发语言·微服务·php