在linux(CentOS7)服务器中,当执行某命令时,如果该命令不存在,会打印出“-bash: xxx: command not found”。
[root@elasticsearch ~]# shasum
-bash: shasum: command not found
[root@elasticsearch ~]#
使用yum install command安装其对应的package时,有时会发现package包不可用,即:“No package shasum available”
[root@elasticsearch ~]# yum install shasum
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package shasum available.
Error: Nothing to do
[root@elasticsearch ~]#
这时怎么办呢?yum provides命令就是用于查找提供特定文件的软件包,无论其文件是否已安装
1.yum provides用法
yum provides <command>
2.yum provides样例
命令:
yum provides shasum
[root@elasticsearch ~]# yum provides shasum
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
1:perl-Digest-SHA-5.85-4.el7.x86_64 : Perl extension for SHA-1/224/256/384/512
#命令的输出将显示提供该文件的软件包及其版本信息。
#如果文件真的未找到,则输出将为空。
Repo : CentOS7
Matched from:
Filename : /us