例如,我正在寻找一个 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_64repoquery 可以做其他查询,例如列出包内容、依赖、反向依赖等.
repoquery can do other queries such as listing package contents, dependencies, reverse-dependencies, etc.
更多推荐
如何找到哪个 rpm 包提供了我正在寻找的文件?
发布评论