CentOS解决找不到命令command not found思路
2019-12-14 本文已影响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