United States (change)
Shortcuts: Downloads Fedora Red Hat Network
You've probably used the Red Hat package management tool, redhat-config-packages, many times. The package management tool makes adding preset groups of software, such as "Editors," a snap, because the tool "knows" what software is required for your selections to be installed successfully. In other words, it resolves RPM dependencies for you.
However, frequently you may want to
install software from your Red Hat distribution that does not appear in
the tool's preset package groups (outside of "Everything," which is
quite a lot of extra packages!). You need only three things to get full dependency
resolution on the fly, for any package you want to install from your
Red Hat Linux distribution:
First, set up the installation tree. For the full skinny, just check out the section entitled "Preparing for a Network Installation," in Chapter 3 of the Red Hat Linux x86 Installation Guide. In short, simply copy the contents of the "RedHat" folder of all three of your installation CD's to a folder to which you have access. Optimally in a networked environment, you could use a public NFS share for all the Red Hat Linux users on the local network.
Second, install the rpmdb-redhat
package, which contains a global RPM database that includes all the package
information for the entire distribution. The database is stored in /usr/lib/rpmdb/i386-redhat-linux/redhat. Installing the rpmdb-redhat package is just as easy as for any package:
rpm -ivh /path/to/rpmdb-redhat-9-0.20030227.i386.rpm
For the third and final step, edit the /etc/rpm/macros.solve file and change the following lines:
%_solve_pkgsdir /path/to/installtree/RedHat/RPMS/
%_solve_name_fmt %{?_solve_pkgsdir}%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
From now on, whenever you need to install an RPM package, you can simply use the rpm --aid switch like this:
rpm -ivh --aid /path/to/installtree/RedHat/RPMS/somepackage.rpm
Voila! Any dependencies for somepackage will be automatically resolved for you, and the additional packages installed as needed.
Note that this method relies completely on the extra database provided by rpmdb-redhat to solve for dependencies. This means that if you create your own custom RPM database, you can use it (after tweaking the %_solve_dbpath macro in /etc/rpm/macros.solve) instead of the "stock" version. Ah, possibilities abound.... Now off you go to rev up RPM!
Paul W. Frields, RHCE, is an engineer and sysadmin by day, working in the arena of computer forensics and criminal investigation, and has been a fanatical Linux user since 1997. He has taught classes in Linux to professionals from around the world, from both public and private sectors. He splits his nighttime hours between spending time with his wife and daughter, and playing bass, guitar, and Chapman Stick in a variety of musical venues.