-
Make sure that the storage and RAM are fine and sufficient and the filesystem is consistent, otherwise you may end up in an endless loop of errors.
-
Switch SELinux to permissive mode or temporarily disable it to avoid related errors.
-
Perform distro-sync and remove duplicates if any, assuming you are using DNF5:
sudo dnf distro-sync --refresh
sudo dnf reinstall $(dnf rq --duplicates --latest-limit=1 --qf="%{name}\n")
Make sure the database points to the latest release, otherwise explicitly specify the release version until the issue is resolved:
sudo dnf --dump-variables
sudo dnf ... --releasever=41
If necessary, ignore protected packages:
sudo dnf ... --setopt=protected_packages=
sudo sed -i -e 's/^/#/' /etc/dnf/protected.d/*
Any blocking package can be manually removed, ignoring its dependencies:
sudo rpm -e --justdb --nodeps package_name
- Check for problems in the RPM database, rebuild it, verify integrity for all installed packages and reinstall corrupted ones if any:
sudo dnf check
sudo rpm --rebuilddb
sudo rpm -V -a
- Enable SELinux and fix labels for the entire filesystem.