Upgrading to Fedora 41 using dnf5

Hello,

I did this: Fedora 41 distro upgrade using dnf5 ($3751987) · Snippets · GitLab

In case anybody want’s to try.

Here’s the pre and post for simplicity. Should be executed as root (or with a sudo prefix in every command).

pre:

# upgrade to Fedora 41
dnf5 -y upgrade --refresh
dnf5 -y install dnf5-plugins
dnf5 -y system-upgrade download --releasever=41
dnf5 -y system-upgrade reboot

post:

# post
# install stuff we need
dnf5 -y install clean-rpm-gpg-pubkey clean-rpm-gpg-pubkey dracut-config-rescue remove-retired-packages rpmconf

# update configs
rpmconf -a

# re-generate grub config (probably not necessary)
grub2-mkconfig -o /boot/grub2/grub.cfg

## clean-up
### packages
remove-retired-packages 41
dnf5 -y remove --duplicates
dnf5 -y remove $( dnf5 repoquery --extras --exclude=kernel,kernel-\* )

### kernels
dnf5 -y remove $( dnf5 repoquery --installonly --latest-limit=-1 -q )

### rpm gpg
 clean-rpm-gpg-pubkey

### remove symlinks (in the entire system)
symlinks -r -d /

## regenerate initramfs and rescue kernels
dracut -fp --regenerate-all
1 Like

I have never had to do this when upgrading fedora, including test upgrades to f41.

Why is it required if you use dnf5?

It will upgrade your grub configuration. Since the grub package get’s updated, it is recommendable to refresh it’s config.

But that is automatic on every kernel install. And that is part of the upgrade, to go from the f40 kernel to the f41 kernel.

I do not recall this every being recommened in the Fedora Magazine how to articles for example.

These are the Fedora docs Upgrading Fedora Linux Using DNF System Plugin :: Fedora Docs and the only ref to grub is for legacy BIOS boot systems.

Yes, you might be right.

Also not needed.

Is this a post install step? Not sure abnout this. I do not recall doing it.

rpmconf is not installed, atleast on my KDE VM.

Oh, but they are needed.

The former helps you regenerate your rescue image. This is why we installed the relevant config file.

The latter is required because there are many configuration files that need to be updated.

Then you need to document why a user may wish to run these optionally steps.