我如何找到哪个rpm包提供了我正在寻找的文件? [英] How do I find which rpm package supplies a file I'm looking for?

查看:132
本文介绍了我如何找到哪个rpm包提供了我正在寻找的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我正在寻找一个mod_files.sh文件,大概会与php-devel包一起来。我猜,yum将安装mod_files.sh文件与php-devel x86_64 5.1.6-23.2.el5_3包,但该文件似乎没有安装在我的文件系统。我如何找到哪个包安装特定的文件?我在寻找的地方,我不一定已经在本地下载的包,其中可能包括我正在寻找的文件。



我使用CentOS 5.

解决方案

这是一个老问题,但目前的答案不正确:)



使用 yum whatprovides ,使用所需文件的绝对路径(可能是通配符)。例如:

  yum whatprovides'* bin / grep'
$ p>

返回

  grep-2.5.1-55.el5.x86_64 :grep模式匹配实用程序的GNU版本。 
Repo:base
匹配项:
文件名:/ bin / grep

您可能更喜欢 repoquery 工具的输出和速度,可在 yum-utils 包中找到。 / p>

  sudo yum install yum-utils 
repoquery --whatprovides'* bin / grep'
grep-0 :2.5.1-55.el5.x86_64
grep-0:2.5.1-55.el5.x86_64

repoquery 可以执行其他查询,例如列出包内容,依赖关系,反向依赖等。


As an example, I am looking for a mod_files.sh file which presumably would come with the php-devel package. I guessed that yum would install the mod_files.sh file with the php-devel x86_64 5.1.6-23.2.el5_3 package , but the file appears to not to be installed on my filesystem. How do I find out which package installs the specific file? I'm looking for where I have not necessarily already locally downloaded the package which may include the file that I'm looking for?

I'm using CentOS 5.

解决方案

This is an old question, but the current answers are incorrect :)

Use yum whatprovides, with the absolute path to the file you want (which may be wildcarded). For example:

yum whatprovides '*bin/grep'

Returns

grep-2.5.1-55.el5.x86_64 : The GNU versions of grep pattern matching utilities.
Repo        : base
Matched from:
Filename    : /bin/grep

You may prefer the output and speed of the repoquery tool, available in the yum-utils package.

sudo yum install yum-utils
repoquery --whatprovides '*bin/grep'
grep-0:2.5.1-55.el5.x86_64
grep-0:2.5.1-55.el5.x86_64

repoquery can do other queries such as listing package contents, dependencies, reverse-dependencies, etc.

这篇关于我如何找到哪个rpm包提供了我正在寻找的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆