linux命令(CentOS7)yum provides

在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    : /usr/bin/shasum



[root@elasticsearch ~]# 
[root@elasticsearch ~]# yum install perl-Digest-SHA-5.85-4.el7.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package perl-Digest-SHA.x86_64 1:5.85-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                   Arch                             Version                                  Repository                         Size
=============================================================================================================================================================
Installing:
 perl-Digest-SHA                           x86_64                           1:5.85-4.el7                             CentOS7                            58 k

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

Total download size: 58 k
Installed size: 110 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-Digest-SHA-5.85-4.el7.x86_64                                                                                                       1/1 
  Verifying  : 1:perl-Digest-SHA-5.85-4.el7.x86_64                                                                                                       1/1 

Installed:
  perl-Digest-SHA.x86_64 1:5.85-4.el7                                                                                                                        

Complete!
[root@elasticsearch ~]# shasum --help
Usage: shasum [OPTION]... [FILE]...
Print or check SHA checksums.
With no FILE, or when FILE is -, read standard input.

  -a, --algorithm   1 (default), 224, 256, 384, 512, 512224, 512256
  -b, --binary      read in binary mode
  -c, --check       read SHA sums from the FILEs and check them
  -t, --text        read in text mode (default)
  -p, --portable    read in portable mode
                        produces same digest on Windows/Unix/Mac
  -0, --01          read in BITS mode
                        ASCII '0' interpreted as 0-bit,
                        ASCII '1' interpreted as 1-bit,
                        all other characters ignored

The following two options are useful only when verifying checksums:
  -s, --status      don't output anything, status code shows success
  -w, --warn        warn about improperly formatted checksum lines

  -h, --help        display this help and exit
  -v, --version     output version information and exit

When verifying SHA-512/224 or SHA-512/256 checksums, indicate the
algorithm explicitly using the -a option, e.g.

  shasum -a 512224 -c checksumfile

The sums are computed as described in FIPS-180-4.  When checking, the
input should be a former output of this program.  The default mode is to
print a line with checksum, a character indicating type (`*' for binary,
` ' for text, `?' for portable, `^' for BITS), and name for each FILE.

Report shasum bugs to mshelor@cpan.org
[root@elasticsearch ~]# 

另外,使用yum provides命令,需要具有root用户或具有sudo权限。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小黑要上天

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值