我如何找到哪个rpm包提供了我正在寻找的文件?

编程入门 行业动态 更新时间:2024-10-09 06:28:58
本文介绍了我如何找到哪个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包提供了我正在寻找的文件?

本文发布于:2023-07-04 09:23:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1022348.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   rpm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!