yum whatprovides 以及 rpm -qf 命令解析

yum whatprovides 

man 文档里面这样描述:

provides or whatprovides
              Is  used  to  find out which package provides some feature or file. Just use a specific name or a file-glob-syntax wildcards to  list the packages available or installed that provide that feature or file.

 

yum whatprovides + 指令,来查看是哪一个软件包提供了这样要给指令

或者可以用

yum whatprovides + 文件,来查看是那儿一个软件包提供的这样的文件

同时我们还可以使用

rpm -qf +文件,来查看文件是那个软件包提供的

例如我们查看etc/hosts这样一个文件是谁提供的我们可以使用

yum whatprovides /etc/hosts

[root@VM_0_4_centos yum.repos.d]# yum whatprovides /etc/hosts
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
setup-2.8.71-10.el7.noarch : A set of system configuration
                           : and setup files
Repo        : os
Matched from:
Filename    : /etc/hosts



setup-2.8.71-10.el7.noarch : A set of system configuration
                           : and setup files
Repo        : @anaconda
Matched from:
Filename    : /etc/hosts

或者

 rpm -qf /etc/hosts

[root@VM_0_4_centos yum.repos.d]# rpm -qf /etc/hosts
setup-2.8.71-10.el7.noarch
[root@VM_0_4_centos yum.repos.d]# 

至于rpm -qf 能不能查询命令具体处于那儿一个软件包,我在仔细研究研究~~~~

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值