Automatically Install RPM Dependencies

RPM packages are used to download and install the software in RPM-based Linux distributions like CentOS, RHEL, Fedora, and SUSE. RPM packages only contain the software and metadata about the package but they do not contain the dependencies. Dependencies are required to install and run the software properly. Even the yum and dnf commands automatically resolve, download, and install dependencies the rpm command does not automatically resolve, download and install software dependencies or required libraries. In this tutorial, we examine how to automatically download and install RPM package dependencies.

Install RPM and Dependencies with “yum install” Command

The rpm command is a defacto command to install RPM packages but it does not install the RPM package dependencies automatically. The yum install command can be used to install an RPM package with its dependencies automatically without any extra action to install dependencies.

$ sudo yum install httpd-2.4.2-1.x86_64.rpm

Install RPM and Dependencies with “yum localinstall” Command

For older versions of CentOS, RHEL, or Fedora the yum localinstall command is provided in order to install local RPM packages with their dependencies.

$ sudo yum localinstall httpd-2.4.2-1.x86_64.rpm

Leave a Comment