How to make rpm auto install dependencies
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.
Create a (local) repository and use yum
to have it resolve the dependencies for you.
The CentOS wiki has a nice page providing a how-to on this. CentOS wiki HowTos/CreateLocalRepos.
Summarized and further minimized (not ideal, but quickest):
- Create a directory for you local repository, e.g.
/home/user/repo
. - Move the RPMs into that directory.
Fix some ownership and filesystem permissions:
# chown -R root.root /home/user/repo
Install the
createrepo
package if not installed yet, and run# createrepo /home/user/repo # chmod -R o-w+r /home/user/repo
Create a repository configuration file, e.g.
/etc/yum.repos.d/myrepo.repo
containing[local] name=My Awesome Repo baseurl=file:///home/user/repo enabled=1 gpgcheck=0
Install your package using
# yum install packagename