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

9,397

Solution 1

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.)

Solution 2

Yes, it is possible, relevant options for dnf are:

  • --downloadonly Download resolved package set without performing any rpm transaction (install/upgrade/erase).
  • --downloaddir=<path> Redirect downloaded packages to provided directory. The option has to by used together with --downloadonly command line option or with download command (dnf-plugins-core).

On recipient machine install downloaded packages dnf install /path/to/rpm

Share:
9,397

Related videos on Youtube

karim
Author by

karim

Updated on September 18, 2022

Comments

  • karim
    karim over 1 year

    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.

  • wisbucky
    wisbucky about 4 years
    For dnf download, if you get No such command error, then you need to do dnf install dnf-plugins-core