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

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

问题描述

例如,我正在寻找一个 mod_files.sh 文件,该文件可能会随 php-devel 包一起提供.我猜想 yum 会使用 php-devel x86_64 5.1.6-23.2.el5_3 包安装 mod_files.sh 文件,但是文件似乎没有安装在我的文件系统上.

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 a 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.

我使用的是 CentOS 5.

I'm using CentOS 5.

推荐答案

这是一个老问题,但目前的答案是错误的:)

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

使用 yum whatprovides,带有您想要的文件的绝对路径(可能是通配符).例如:

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

yum whatprovides '*bin/grep'

返回

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

您可能更喜欢 yum-utils 包中提供的 repoquery 工具的输出和速度.

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 可以做其他查询,例如列出包内容、依赖、反向依赖等.

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

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

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