Yum Local Install to Install a Package with Its Dependency

I have downloaded a package with it's dependency and want to install a package with dependency. Even though i have download in local folder it's checking for online.

sudo yum -y --disablerepo=* localinstall autoconf-2.69-11.el7.noarch.rpm

I am trying above command but failed to load it's dependency that is there in same folder.

Thanks, Hare

1

2 Answers

Inside the local directory where you have all the downloaded RPMs, do this:

 sudo yum --disablerepo=* localinstall *.rpm

OR

 sudo yum --disablerepo=* localinstall foo.rpm bar.rpm baz.rpm

Since you have downloaded all the dependencies to a single directory, you can also use rpm to install those:

 sudo rpm -Uvvh *.rpm --test

--test does a dry-run. Remove it to install on disk.

Even if the solution provide by iamauser is very great (and I am using it all the time), I wish to give you an other way to do it.

It exists yum-downloader command which doing basically the same thing for you.

# yumdownloader <package> --resolve

You just have to download it first :

# yum install yum-utils

Overall, I suggest you to read this article from Red Hat company site's which details everything about those two methods :

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest