I used dnf to system-upgrade to F40, which downloaded all the relevant
packages, and then I rebooted through dnf.
The restart updated all the packages and automatically rebooted when it
was finished.
[...]
This was a lot of work to resolve, and is the worst experience I've had
with any fedora system upgrade.