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权限。

相关推荐

  1. linux命令(CentOS7)yum provides

    2024-03-25 06:38:06       41 阅读
  2. 宝塔-Linux模板常用命令-centos7

    2024-03-25 06:38:06       27 阅读
  3. Linux 基础常用基础命令CentOS7)-CSDN

    2024-03-25 06:38:06       28 阅读
  4. centos7 基础命令

    2024-03-25 06:38:06       33 阅读
  5. LinuxCentOS部分命令

    2024-03-25 06:38:06       58 阅读
  6. CentOS 7挂载命令详解

    2024-03-25 06:38:06       32 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-25 06:38:06       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-25 06:38:06       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-25 06:38:06       87 阅读
  4. Python语言-面向对象

    2024-03-25 06:38:06       96 阅读

热门阅读

  1. 网络基础:构建你的数字世界之桥

    2024-03-25 06:38:06       36 阅读
  2. 面试宝典:MySQL索引进阶深度分析

    2024-03-25 06:38:06       38 阅读
  3. Android下的Touch事件分发详解

    2024-03-25 06:38:06       36 阅读
  4. 【Android 内存优化】Koom核心内存指标分析

    2024-03-25 06:38:06       40 阅读
  5. 【兆易创新GD32H759I-EVAL开发板】USB设备 介绍1

    2024-03-25 06:38:06       42 阅读
  6. 维吉尼亚(Vigenere)密码

    2024-03-25 06:38:06       38 阅读
  7. python | yield用法详解

    2024-03-25 06:38:06       43 阅读
  8. Spring自定义注解

    2024-03-25 06:38:06       36 阅读