tags:

views:

351

answers:

4

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.

A: 

If something big is missing I'll Google it to find the rpm. Otherwise, for a shell script or something similar, I'll just install the file manually.

Jess
+1  A: 

rpm -qf myfilename

dj_segfault
A: 

You go to http://www.rpmfind.net and search for the file.

You'll get results for a lot of different distros and versions, but quite likely Fedora and/or CentOS will pop up too and you'll know the package name to install with yum

nos
+1  A: 

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:

sudo 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
rjh