O'Reilly logo

Linux Annoyances for Geeks by Michael Jang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Avoid Dependency Hell with yum

RPM packages include all the dependency information you need. Each RPM includes headers that list any other RPMs that are required to make it work. For example, when I tried to install the GNU C Compiler (gcc) on Fedora Core 3, I got the following message:

# rpm -i gcc-3.4.2-6.fc3.i386.rpm
error: Failed dependencies: 

    glibc-devel >= 2.2.90-12 is needed by gcc-3.4.2-6.fc3.i386

Thanks to the information in the header of the gcc RPM package, I now know that I need a glibc-devel RPM of a certain version or greater. So I download the glibc-devel package from my favorite Fedora mirror, and try to install that:

# rpm -i glibc-devel-2.3.3-74.i386.rpm
error: Failed dependencies:
     glibc-headers is needed by glibc-devel-2.3.3-74.i386
     glibc-headers = 2.3.3 is needed by glibc-devel-2.3.3-74.i386

I'm a patient person, so I try again. I download the glibc-headers RPM and try installing that. I get the following result:

# rpm -i glibc-headers-2.3.3-74.i386.rpm
error: Failed dependencies:
     kernel-headers is needed by glibc-headers-2.3.3-74.i386
     kernel-headers >= 2.2.1 is needed by glibc-headers-2.3.3-74.i386

This process, which can go on for several levels, is also known as dependency hell.

With the yum command, you can take advantage of the headers to trace back through all dependencies automatically. Because yum repositories collect these headers in a database, you can install the GNU C Compiler and all dependent packages with the following command:

yum install gcc

This command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required