美文网首页
CentOS解决找不到命令command not found思路

CentOS解决找不到命令command not found思路

作者: 风静花犹落 | 来源:发表于2019-12-14 18:25 被阅读0次

一、执行命令时发现找不到该命令

[root@localhost ~]# semanage port -l | grep mysqld
-bash: semanage: command not found

二、遂安装其命令,发现没有该软件包

[root@localhost ~]# yum install semanage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirrors.btte.net
* updates: mirrors.btte.net
No package semanage available.
Error: Nothing to do

三、查询提供该命令的软件包

[root@localhost ~]# yum provides semanage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirrors.btte.net
* updates: mirrors.btte.net
policycoreutils-python-2.2.5-20.el7.x86_64 : SELinux policy core python utilities
Repo : base
Matched from:
Filename : /usr/sbin/semanage

四、得到提供该命令的软件包

policycoreutils-python-2.2.5-20.el7.x86_64 : SELinux policy core python utilities

五、安装查询出来的软件包

[root@localhost ~]# yum install policycoreutils-python

六、查找命令所在目录

[root@localhost ~]# which semanage
/usr/sbin/semanage

相关文章

网友评论

      本文标题:CentOS解决找不到命令command not found思路

      本文链接:https://www.haomeiwen.com/subject/rvchnctx.html