linux – 提供文件的rpm

前端之家收集整理的这篇文章主要介绍了linux – 提供文件的rpm前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
列出什么rpms可以提供特定文件的命令是什么:提供已安装文件的rpm或可提供未安装文件的rpm?

解决方法

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

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

  1. [jb@smokey ~]$yum whatprovides "/etc/sudoers"
  2. sudo-1.6.9p13-8.fc9.x86_64 : Allows restricted root access for specified users
  3. Repo : updates-newkey
  4. Matched from:
  5. Filename : /etc/sudoers
  6.  
  7. sudo-1.6.9p13-4.fc9.x86_64 : Allows restricted root access for specified users
  8. Repo : fedora
  9. Matched from:
  10. Filename : /etc/sudoers
  11.  
  12. sudo-1.6.9p13-8.fc9.x86_64 : Allows restricted root access for specified users
  13. Repo : installed
  14. Matched from:
  15. Other : Provides-match: /etc/sudoers

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

  1. yum whatprovides "*foo*"

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

  1. yum whatprovides "*bin/foo"

猜你在找的Linux相关文章