Dnf system-upgrade download --releasever=36 --downloadonly --downloaddir=upgrade-35-to-36

Hi!

As i have several computers with Fedora 35, i came to a brilliant idea to download all packages to one folder, and then copy those packages, actually rpm files, to each one of mine computers.

Downloading is easy with dnf:

dnf system-upgrade download --releasever=36 --downloadonly --downloaddir=upgrade-35-to-36

But what now with all those files in upgrade-35-to-36 folder ?

How to tell upgrade to use them, as the last Fedora 35 command should be:

dnf system-upgrade reboot

Many thanks!

2 Likes

When you do a full system upgrade like that the normal path for the packages and all the metadata is under /var/lib/dnf. If you look at the content of your download directory where you put everything it likely has the metadata and dir structure like I see here. If so then it should be fairly simple to copy stuff over and do the upgrade on that system.

$ ls -l /var/lib/dnf
total 13868
-rw-r--r--.  1 root root 8560640 May 16 18:23 history.sqlite
-rw-r--r--.  1 root root   32768 May 16 18:23 history.sqlite-shm
-rw-r--r--.  1 root root 5586752 May 16 02:20 history.sqlite-wal
drwxr-xr-x. 21 root root    4096 Apr 24 12:41 repos
drwxr-xr-x.  2 root root    4096 Apr 21 21:36 system-upgrade
-rw-r--r--.  1 root root    1526 Dec 11  2020 system-upgrade.json

The --downloadonly option was redundant since dnf system-upgrade download only downloads the needed packages.

Personally I would have done dnf system-upgrade download --releasever=36 then when it was complete I would have copied the entire content of /var/lib/dnf to the other machines then repeated the dnf system-upgrade download --releasever=36 there to make certain all packages needed were ready. Then I would upgrade each them with dnf system-upgrade reboot before I did the reboot step on the machine I used for the download. The extra download step would only download packages not already in the cache to upgrade that way.

1 Like

Many thanks Jeff V

Now i should copy from upgrade-35-to-36 to each of folders:

/var/lib/dnf/system-upgrade/fedora-e58e3c9673d413e5/packages
/var/lib/dnf/system-upgrade/updates-a50f2ed408319fa8/packages
/var/lib/dnf/system-upgrade/rpmfusion-free-d6320b298ef4eb94/packages
/var/lib/dnf/system-upgrade/rpmfusion-nonfree-edc23177a09024b2/packages

How to find out which package rpm file to which folder?

And what about file /var/lib/dnf/histroy.sqlite

I think that histroy.sqlite can help, especially tables repo and trans_item, but…

Anyway, I think i should clear folders fedora , updates , rpmfusion-free and rpmfusion-nonfree in /var/lib/dnf/system-upgrade and download F36 upgrade packages again. Reason is that now i have a mess in /var/lib/dnf/system-upgrade/ - as i copyed all upgrade-35-to-36 files to each folders i mentioned above.

After timeconsuming download i will have all rpm packages which i will then copy to folder /var/lib/dnf/ on other machines.

Maybe last question - should histroy.sqlite be copied also, before i start dnf system-upgrade download --releasever=36 on each machine ?

Many thanks!

What if one of your several computers requires an (additional) package that wasn’t downloaded on your machine no.1?

Seems unlikely that they are all identical systems.

What I would do:
Run one of your machines or a VM as cache for your local network, for example squid. requested package there, great, local download; requested file not there, go fetch it from Fedora mirror

Hi augenauf !!!

On a first moment I think your idea is much better than my brilliant one :slight_smile:

But for that, i have to figure out how to setup cache.

And i already see a problem with that approach - what if my 2nd machine is downloading from different mirror repository than the 1st one ?

:wink:

Maybe this is useful as well…

2 Likes

you point all your machines to a specific mirror before initiating the upgrade…

1 Like

Hi!

As Jeff V said:

Personally I would have done dnf system-upgrade download --releasever=36 then when it was complete I would have copied the entire content of /var/lib/dnf to the other machines then repeated the dnf system-upgrade download --releasever=36 there to make certain all packages needed were ready. Then I would upgrade each them with dnf system-upgrade reboot before I did the reboot step on the machine I used for the download. The extra download step would only download packages not already in the cache to upgrade that way.

I think i will stick to Jeff V solution:

Then I would upgrade each them with dnf system-upgrade reboot before I did the reboot step on the machine I used for the download.

The extra download step would only download packages not already in the cache to upgrade that way.

PS: i am already downloading repository data, maybe thats the main reason to stick that solution.

Latter, i will also try your proposal. Many thanks !!!

Chears :slight_smile:

1 Like

That is immaterial. The packages in the mirrors are synced so it does not matter which mirror is used for the download.