Linux – Is it possible to download rpm files in Fedora for offline usage? (See description)

debfedoralinuxrpmUbuntu

I have a Fedora-installed PC which is disconnected from internet (and there's nothing I can do about it). So I want to download rpm files for various softwares on another PC and then install them later on the former one. So is there a way that I can do that?

On Ubuntu, I used two different ways to achieve this.
One is this, "sudo apt-get install –download-only package-name" and then copy the deb files.
Another method is using synaptic, use the "Generate package download script" and then download the deb files using that script.

However, I'm yet to find a similar way on Fedora. Can you guys help me?

Any help is appreciated. Thank you.

Best Answer

The dnf --downloadonly flag will pull down packages to the local cache without installing them. You can also use the dnf download command to download packages to the current directory (and you can do this as non-root). (This is a plugin; docs at man dnf.plugin.download.)

With dnf download --resolve, you will also get any dependencies which are missing on this system. (If your system matches the target one, this will be convenient.)

Related Question