Saturday, September 3, 2011

Package management in Fedora (or RPM based systems)

The two tools/command used for package management in a RPM based system (like Fedora or Redhat) are:

a). rpm
 - Originally standing for "RedHat Package Manager"
 - Now a recursive acronym for "RPM Package Manager"
 - No pacakge dependencies resolution.

b). yum
 - It stands for "Yellodog Updater, Modified".
 - Re-write of existing tool called "Yellodog Updater (YUP), hence the name.
 - Supports package dependencies resolution.


1. Search for a package named "foobar"
    yum search foobar
    yum search all foobar

2. Install the development files for "foobar"
    yum install foobar-devel

3. Install documentation for "foobar"
    yum install foobar-doc

4. Check if package "foobar" is installed
    rpm -q foobar

5. List all the files installed by package "foobar"
    rpm -ql foobar
    rpm -q foobar | xargs rpm -ql

6. If you have a file say "/etc/foobar.conf" and want to know which package does it belongs to
    rpm -qf /etc/foobar.conf