If you want to find the relationship between files on your system and RPM packages (which one owns/belongs-to which) then this page will be of help to you.

1. Contents of an RPM package:

1.1 This RPM command will show you the contents of a package (the package must be already installed on your system):

rpm -ql <package-name.rpm>

For example: rpm -ql skype will list all the files that the skype package installed onto your system. Note that you don’t need to give the exact name of the package (like skype-2.0.0.72-fc5.i586 in my case). Of course giving the exact name of the package will also work (provided you type it correctly).

1.2 Here’s how to find the contents of an rpm package which is NOT yet installed (i.e. all the files inside the package, and where they will be installed):

rpm -qpl <path/to/file.rpm>

 

2. Which RPM package this file belongs to?

The below command will tell you what RPM package installed a given file onto your machine, i.e. what RPM package the file belongs to or which package “owns” the file (note that the file MUST be already installed for this to work):

rpm -qf /bin/bash

Try this on your system (most have bash :)) and you should see the rpm command output the name of the bash package, something like bash-3.2-23.fc9.i386

Tagged with:
 

2 Responses to What files comprise an RPM package? Which package a file belongs to?

  1. ench0 says:

    Often a poorly packaged app would miss a dependency – usually an shared object library (a .so file). In such cases you’d see an error like:
    /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    So in this case it would be nice to find out which packages provides the ld-linux.so.2 file.

    $ yum whatprovides ld-linux.so.2
    glibc-2.14.90-14.i686 : The GNU libc libraries
    Repo : fedora
    Matched from:
    Other : ld-linux.so.2

    This tells us that the ld-linux so lib is provided by the glibc library. Note that you must give the exact so name to yum whatprovides, whereas when installing you may just type yum install glibc and it will find the correct version.
    (Note: yum is Fedora’s package manager / frontend to the rpm command)

  2. ench0 says:

    This is how you can list all the packages installed on your system:
    yum list installed

    The resulting list of packages will be quite long so if you have an idea what you’re looking for (e.g. if you looking for all the “ncurses” packages) you may do something like:
    yum list installed | grep ncurses

Leave a Reply

Your email address will not be published. Required fields are marked *

Set your Twitter account name in your settings to use the TwitterBar Section.