How to make rpm auto install dependencies

HAL picture HAL · Dec 14, 2012 · Viewed 476.9k times · Source

I have built two RPM packages

  • proj1-1.0-1.x86_64.rpm
  • libtest1-1.0-1.x86_64.rpm

proj1 depends on the file libtest1.so being present and it is reflected correctly in the RPM packages as seen here:

user@my-pc:~$ rpm -qp --requires proj1-1.0-1.x86_64.rpm
libtest1.so()(64bit)

user@my-pc:~$ rpm -qp --provides libtest1-1.0-1.x86_64.rpm
libtest1.so()(64bit)

The installation of proj1 fails due to a missing dependency.

user@my-pc:~$ rpm -ivh proj1-1.0-1.x86_64.rpm
error: Failed dependencies:
libtest1.so()(64bit) is needed by proj1-1.0-1.x86_64.rpm

How do I ensure that libtest1-1.0-1.x86_64.rpm is installed automatically during the installation of proj1-1.0-1.x86_64.rpm?

I did try the --aid option with rpm -i as described here but it didn't work for me.

Is there any other way?

Thanks for any help.

Answer

Matthew picture Matthew · May 6, 2013

The link @gertvdijk provided shows a quick way to achieve the desired results without configuring a local repository:

$ yum --nogpgcheck localinstall packagename.arch.rpm

Just change packagename.arch.rpm to the RPM filename you want to install.

Edit Just a clarification, this will automatically install all dependencies that are already available via system YUM repositories.

If you have dependencies satisfied by other RPMs that are not in the system's repositories, then this method will not work unless each RPM is also specified along with packagename.arch.rpm on the command line.