RPM Installation Errors





RPM Installation Errors

Sometimes the installation of RPM software doesn't go according to plan and you need to take corrective actions. This section shows you how to recover from some of the most common errors you'll encounter.

Failed Dependencies

Sometimes RPM installations will fail, giving Failed dependencies errors, which really means that a prerequisite RPM needs to be installed. In the next example we're attempting to install the MySQL database server application, which fails because the mysql MySQL client RPM, on which it depends, needs to be installed beforehand:

     [[email protected] tmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm
     error: Failed dependencies:
             libmysqlclient.so.10 is needed by mysql-server-3.23.58-9
             mysql = 3.23.58 is needed by mysql-server-3.23.58-9
     [[email protected] tmp]#

Installing the MySQL client also fails because it requires the perl-DBD-MySQL package:

[[email protected] tmp]# rpm -Uvh mysql-3.23.58-9.i386.rpm
error: Failed dependencies:
        perl-DBD-MySQL is needed by mysql-3.23.58-9
[[email protected] tmp]# rpm -Uvh perl-DBD-MySQL-2.9003-4.i386.rpm
error: Failed dependencies:
        libmysqlclient.so.10 is needed by perl-DBD-MySQL-2.9003-4
[[email protected] tmp]#

Strangely enough, the installation of the perl-DBD-MySQL package fails because it needs the mysql client package. To get around this problem you can run the rpm command with the --nodeps option to disable dependency checks. In the next example we install the MySQL client ignoring dependencies, followed by successful installation of perl-DBD-MySQL and mysql-server:

     [[email protected] tmp]# rpm -Uvh --nodeps mysql-3.23.58-9.i386.rpm
     Preparing...        ####################### [100%]
        1:mysql          ####################### [100%]
     [[email protected] tmp]# rpm -Uvh perl-DBD-MySQL-2.9003-4.i386.rpm
     Preparing...        ####################### [100%]
        1:perl-DBD-MySQL ####################### [100%]
     [[email protected] tmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm
     Preparing...        ####################### [100%]
        1:mysql-server   ####################### [100%]
     [[email protected] tmp]#

Note

If all the installation RPMs are located in the same directory, the rpm command can automatically install all the prerequisite RPMs using the --aid option. One of the advantages of using the yum facility is that you don't have to worry about this dependency process as much because the dependency RPMs are always downloaded and installed automatically also.


Signature Keys

Fedora digitally signs all its RPM files, so it's best to import their public encryption key beforehand so that the RPM installation program will be able to verify the validity of the RPM file. This can be done using the rpm command as seen in the next example. It is a good idea to import both the Red Hat and Fedora keys:

     [[email protected] tmp]# rpm --import /usr/share/rhn/RPM-GPG-KEY
     [[email protected] tmp]# rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
     [[email protected] tmp]#

If you don't install the keys you get a DSA signature warning that alerts you to the fact that the RPM file might be bogus:

     [[email protected] tmp]# rpm -Uvh dhcp-3.0pl2-6.16.i386.rpm
     warning: dhcp-3.0pl2-6.16.i386.rpm: V3 DSA signature: NOKEY, key ID
     4f2a6fd2
     Preparing...           #################################### [100%]
        1:dhcp              #################################### [100%]
     [[email protected] tmp]#

It is always good to install the key files. If they are not there, the RPMs will install with only a warning message. If the RPM's digital signature doesn't match that in the key file, the rpm installation program also alerts you and fails to install the RPM package at all:

     [[email protected] tmp]# rpm -Uvh dhcp-3.0pl2-6.16.i386.rpm
     error: dhcp-3.0pl2-6.16.i386.rpm: V3 DSA signature: BAD, key ID
     4f2a6fd2
     error: dhcp-3.0pl2-6.16.i386.rpm cannot be installed
     [[email protected] tmp]#

Signatures are therefore useful because they help protect you against tampered and otherwise corrupted RPMs being installed.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows