Is it only 40 GB? There are ~65,000 packages in the main Ubuntu repo.
Right new Fedora is around 38GB. That's about 43,000 packages.
If you add the rpmfusion repos it's about another 12GB.
The Debian world definitely has more packages, for example I think there are about 12 music players.
The fedora world only has 6 or 7. Fedora only has 4 browsers in their repo. I see firefox, chromium, badwolf, seamonkey and netsurf. There's also elinks, lynx, qutebrowser and browsh. So partly it's just fewer options.
But the other thing, is how long a repo holds on to "older versions". The Redhat 8 repo is quite a bit larger than the
fedora repo, even though it less appllication choices. How can that be? Well, for example fedora 42 have only had
12 kernel releases but it only hangs around about a year, then you have to upgrade. Redhat 8 on the other hand has
31 kernel releases because it has to hang around for 7 years.
How long is Ubuntu LTS supported? 5 years? That's 10 releases of fedora. I suppose it could be possible that if you had all the fedora repos from say... 31, 32, ... up to 41. The total sizes would be a lot closer.
I have noticed it's much the same Debian and other LTS distro's. The repos are bigger because they have to keep older versions of stuff. I notice for example Ubuntu 24 has gfortran 9, 10, 11, 12, 13 and 14. In fedora you only get 13 and 14.
But I wonder, for some distros, as more and more applications go to snap/appImage/flatPak, etc... will traditional repos still be a thing?