加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 提供文件的rpm

发布时间:2020-12-13 18:29:15 所属栏目:Linux 来源:网络整理
导读:列出什么rpms可以提供特定文件的命令是什么:提供已安装文件的rpm或可提供未安装文件的rpm? 解决方法 对于已安装的文件/包: [jb@smokey ~]$rpm -qf /etc/sudoerssudo-1.6.9p13-8.fc9.x86_64 对于尚未安装的文件包: [jb@smokey ~]$yum whatprovides "/etc/
列出什么rpms可以提供特定文件的命令是什么:提供已安装文件的rpm或可提供未安装文件的rpm?

解决方法

对于已安装的文件/包:
[jb@smokey ~]$rpm -qf /etc/sudoers
sudo-1.6.9p13-8.fc9.x86_64

对于尚未安装的文件&包:

[jb@smokey ~]$yum whatprovides "/etc/sudoers"
sudo-1.6.9p13-8.fc9.x86_64 : Allows restricted root access for specified users
Repo        : updates-newkey
Matched from:
Filename    : /etc/sudoers  

sudo-1.6.9p13-4.fc9.x86_64 : Allows restricted root access for specified users
Repo        : fedora
Matched from:
Filename    : /etc/sudoers

sudo-1.6.9p13-8.fc9.x86_64 : Allows restricted root access for specified users
Repo        : installed
Matched from:
Other       : Provides-match: /etc/sudoers

请注意,“yum whatprovides”是一种模式匹配,因此如果您不确定您要查找的文件在目录结构中的位置,请使用引号和星号将其包围:

yum whatprovides "*foo*"

同样,如果您确定要查找的是二进制文件,则可以执行以下操作:

yum whatprovides "*bin/foo"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读