Yum and RPM Tips

Get the dependency

If the package is already installed, use "rpm -qR <package-name>" to get the list of packages that this package depends on. For example:

$ rpm -qR openldap

If the package is not yet installed, use "yum  deplist <package-name>" to get the list of packages that this package depends on. For example:

$ yum deplist postfix

 

Multiple installation of the same RPM

If the RPM package is relocatable, then we can install it into multiple location:

$ rpm -Uhv --prefix /data1 rpm-pkg.rpm
$ rpm --force -ihv --prefix /data2 rpm-pkg.rpm

With such installation, we need to remember not to use yum to upgrade the package later, or use the rpm to upgrade the package without specifying the prefix. 

Remove multiple installation of the same RPM

Try this:

$ rpm -e -vv --allmatches --nodeps --noscripts --notriggers <package-name>

 

Default RPM Macros

The default RPM macro variables are stored in /usr/lib/rpm/macros. The default RPM rc file is /usr/lib/rpm/rpmrc.

More tips: