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

2

Best Answer


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 :https://access.redhat.com/solutions/10154