While using localinstall with rpm files with dependencies locally present, redirecting to mirrors list

While using localinstall with rpm files with dependencies also locally present, redirecting to mirrors list, and getting as there was no network, but with network as well sometime it failed.

Rocky linux version 8.7

Can anyone please guide me fix this issue to localinstall should look locally, not look on internet to download

Already tested on redhat 8.7 and localinstall does not require internet if all dependant rpm are present

The localinstall is a deprecated alias for install.
The “redhat 8.7” should not work any “better” than the Rocky does.


If foo requires bar, and you have both foo.rpm and bar.rpm, then:

dnf install bar.rpm
dnf install foo.rpm

or

dnf install bar.rpm foo.rpm
1 Like

Got the reason of the issue.
When i have disabled the repo on rocky , it was looking locally only and that have fixed my issue.
In redhat repo is already disabled so did not get the issue their

I believe you have to “cd” to the local directory where the local rpm’s are and run dnf while there. I’ve never had to disable repo’s.

It is for air gap environment where internet will not be there.
So all the rpm packages are locally downloaded and the it will be installed through dnf localinstall *.rpm
As the repo were enabled so it is redirecting to mirror lists and as network was not there it is throwing error.
So disabled the repo and then it didn’t go to mirror list

You could use createrepo_c to generate repo metadata from those packages.
Then define a repo (in /etc/yum.repos.d/) that points to your local repository path.

As I said earlier, the dnf localinstall *.rpm is exactly same as dnf install *.rpm
and dnf --disablerepo=* install *.rpm is ad hoc “install without repos”, while
dnf config-manager --disable baseos appstream extras disables those three repos.

1 Like