How do I find which rpm package supplies a file I'm looking for?

rpm list files in package
yum whatprovides command
yum list files in package
rpm list installed packages
find rpm package
rpm what files in package
rpm find files in rpm
in what directory are yum repository configuration files stored?

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.

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.

How to find which rpm package provides a specific file or library in , You can find the rpm package which provides a specific file using either rpm or yum command. Use the command 'rpm -qf' or 'yum whatprovides' to get the  There 2 commands which can help you find the rpm package from the file – rpm and yum. You can also find all the files included in a package with the rpm command. Find rpm package which provides a particular binary file or library file 1. Method 1 : using rpm command. 1. Use below rpm commands to find which rpm package provide a particular file.

To know the package owning (or providing) an already installed file:

rpm -qf myfilename

Note: this command does not require to be run as root (on the contrary of sudo yum whatprovides myfilename)

How To Find The Package That Provides A Specific File In Linux , If the file is already available in your system, say for example /bin/ls, you can then find the package that owns the file using command: # rpm -qf  rpm: Find out what files are in my rpm package. Use following syntax to list the files for already INSTALLED package: rpm -ql package-name. Use following syntax to list the files for RPM package: rpm -qlp package.rpm . Type the following command to list the files for gnupg*.rpm package file: $ rpm -qlp rpm -qlp gnupg-1.4.5-1.i386.rpm Sample outputs:

The most popular answer is incomplete:

Since this search will generally be performed only for files from installed packages, yum whatprovides is made blisteringly fast by disabling all external repos (the implicit "installed" repo can't be disabled).

yum --disablerepo=* whatprovides <file>

How do I find which rpm package supplies a file I'm , Question. 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  A blog about on new technologie. Hands-on note about Hadoop, Cloudera, Hortonworks, NoSQL, Cassandra, Neo4j, MongoDB, Oracle, SQL Server, Linux, etc.

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

Discover to which package a file belongs to, We have gathered this information for multiple Linux distributions. CentOS, Fedora, RHEL. Show files for RPM packages. rpm -qlp /path/to/file.rpm  If we find which package provide that package, that will save us not to install unnecessary packages in the process of installing this command. Redhat provids options with yum and rpm commands to check for the package name if we give file name to these commands.

Well finding the package when you are connected to internet (repository) is easy however when you only have access to RPM packages inside Redhat or Centos DVD (this happens frequently to me when I have to recover a server and I need an application) I recommend using the commands below which is completely independent of internet and repositories. (supposably you have lots of uninstalled packages in a DVD). Let's say you have mounted Package folder in ~/cent_os_dvd and you are looking for a package that provides "semanage" then you can run:

for file in `find ~/cent_os_dvd/ -iname '*.rpm'`;  do rpm -qlp $file |grep '.*bin/semanage';  if [ $? -eq 0 ]; then echo "is in";echo $file  ; fi;  done

Debian / Ubuntu Linux: Find Out What Package Provides a File , I use the rpm -qf /bin/ls command under Red Hat Enterprise Linux to find out package name. Can you tell me the equivalent command for the  You can finding out what dependencies a rpm file has i.e. it will tell you what you need to install package with following command: rpm -qpR {.rpm-file} rpm -qR {package-name}

How do I find which rpm package supplies a file I'm looking for , You can use yum whatprovides command, with the absolute path to the file you want (which may be wildcarded). For example: The rpm files themselves are downloaded and then installed. Once these files are installed, they are tracked by the rpm database. To see where the files for a particular rpm were installed, you can run rpm -ql .

Which rpm package supplies isofs.ko kernel module?, With Fedora Core 20 the kernel package supplies the isofs.ko file. Is it available for RHEL 6 and RHEL 7. Resolution. For RHEL 5 and RHEL 6:. Extract files from an RPM package’s cpio archive. The rpm2cpio command will output (to stdout) a cpio archive from the RPM package. To extract the package files we’ll use the output from rpm2cpio and then use the cpio command to extract and create the files we need. For example:

RPM Packaging Guide Red Hat Enterprise Linux 7, Here is a complete, working RPM Spec file with several things skipped and Different distributions will supply different sets of recommended RPM Macros  A file with the RPM file extension is a Red Hat Package Manager file that's used to store installation packages on Linux operating systems. RPM files provide an easy way for software to be distributed, installed, upgraded, and removed since the files are "packaged" in one place.

Comments
  • superuser.com___?
  • @Grzegorz Good point, I've put in a vote to move.
  • here's a better answer: unix.stackexchange.com/a/4706/39281
  • @SamWatkins that answer will only work if the package that supplies the file you're looking for is already installed on the system. If the package is not installed (as the OP says) then you can't use rpm, you need to use yum.
  • This tells which packages owns (or provided) an already installed file. Thankfully, that's what I was looking for!
  • yum whatprovides ... doesn't need root either
  • this command looks to be more efficient than yum whatprovides--no need to get updates from possibly slow repositories.
  • This version also works on non redhat based distro's that still use rpm's such as openSUSE
  • It seems to me that rpm -qf <filename> is best suited for determining which package provides an installed application (since it may be different than what is in the current yum repository cache), and yum whatprovides <filename> is best suited for determining which package provides a yet-to-be-installed application. Each has their own purpose.
  • In this case, however, the OP is specifically looking for a missing file that was not installed on the system, even after installing a package he thought would have it, so he can't use --disablerepo=*
  • This website is offline!
  • The website does not appear to search for files; only package names with the search term.
  • @jww Searching for files works fine for me at least. As the docs says, you can search for executables by their single path name or any file with the absolute path name.