Dealing with dependency problems in rpm distributions

If you use Redhat, CentOS, Fedora, or any other rpm-based Linux distribution and haven’t figured out how to deal with installing dependencies, here’s the solution:

For this tutorial, all my file names are theoretical – meaning they may or may not exist – but the point of this article is so you… get the point

When I installed Cisco’s Packet Tracer on my CentOS 6 machine, I ran the following command:

rpm -ivh packettracer.rpm

Unfortunately, the installation failed because Packet Tracer has a dependency which prevents it from being installed – unless the dependency is installed. In this case, Packet Tracer complained that wasn’t installed.

Before we go further, let’s see what dependencies aren’t installed!
If you have installed a program, but it won’t start – or maybe it has wierd issues where it just closes for no reason, there is a way to check if the required libraries are all installed.

Pretend that Packet Tracer did install, but won’t start. We can check the missing libraries by running this command (against the executable):

ldd /usr/bin/packettracer

Replace /usr/bin/packettracer with the path of your executable – it could be /opt/pt/PacketTracer5/PacketTracer5 or /usr/local/PacketTracer/bin/packerttracer for instance.

After running the ldd command above, do you see any “not found” remarks? If so, then you can find the package that provides the missing dependency (in our case, by running this command (as root):

yum whatprovides

YUM will tell us that libpng-4.436.345-3.i686 (remember these are made up versions and releases) is the package that provides the dependency.

Now you can install the package (ommit the version and release numbers, but include the architecture as shown):

yum install libpng-4.i686

Now the dependencies for are installed.