How does Discover calculate the size of the updates?


When I do a dnf update it show for today’s updates that 28 packages will be upgraded with the total download size of 22 M.

However, Discover shows the same 28 packages with 70.6 MiB.

Is it because discover is calculating the size on disk (vs dnf’s download size)?
If so: how can I get the size on disk with dnf and the download size with Discover?

Or maybe it’s just a bug in Discover that is summing up the sizes of all available packages (e.g. pkcon get details fwupd)?

Probably, yes — those numbers line up, and DNF does indeed show download size rather than size on disk.

Somewhat convoluted way to check install size of updates using repoquery:

$ sudo dnf upgrade --assumeno | tail -1
Operation aborted.
Total download size: 44 M
$ dnf -qC rq --upgrades --queryformat '+ %{downloadsize}' | xargs echo 0 | bc | numfmt --to=iec
$ dnf -qC rq --upgrades --queryformat '+ %{installsize}' | xargs echo 0 | bc | numfmt --to=iec

As far as I can tell, dnf shows download size for any package that is not installed (e.g. install or upgrade transactions), but install size for any package that is installed (e.g. remove transactions).

This applies to various dnf commands in confusing ways. If you have an available update for a package, dnf info <package> shows install size for the installed package, but download size for the available package. Same for dnf swap, it always makes me pause when swapping two nearly identical packages but the removed one has a much larger size.

1 Like