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

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

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

发布评论

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

>www.elefans.com

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