解决方法
对于已安装的文件/包:
- [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"