Upgrading to fedora 41 using dnf5 fails due to conflicts

Hi guys this is the error I get when trying to upgrade to fedora 41 I have even tried changing the names of the related files without any results. Any known solutions?

Transaction failed: Rpm transaction failed.

  • file /etc/dnf/dnf.conf from install of libdnf5-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-data-4.21.1-1.fc40.noarch
  • file /usr/share/man/man5/dnf.conf.5.gz from install of dnf5-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-data-4.21.1-1.fc40.noarch

I used dnf4 to do the upgrade to f41 successfully.
I have not bern using dnf5 on f40.

You could remove the conflicting dnf5 from f40 and use dnf (dnf4) to do the system-upgrade.

Changing the file names would have no affect. The installed file information is stored in a database and that is what is checked when you see those errors.

I was suggesting to uninstall the unnecessary, on f40, dnf5 package to eliminate the conflict, then the upgrade can succeed.

I was replying to the OP.

the errors generated after using dnf4 seems to be more than when using dnf5 here is the output:(I removed dnf5 before trying to upgrade)

Error: Transaction test error:
file /etc/dnf/dnf.conf from install of libdnf5-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-data-4.21.1-1.fc40.noarch
file /usr/share/man/man8/dnf-builddep.8.gz from install of dnf5-plugins-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch
file /usr/share/man/man8/dnf-changelog.8.gz from install of dnf5-plugins-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch
file /usr/share/man/man8/dnf-config-manager.8.gz from install of dnf5-plugins-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch
file /usr/share/man/man8/dnf-copr.8.gz from install of dnf5-plugins-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch
file /usr/share/man/man8/dnf-needs-restarting.8.gz from install of dnf5-plugins-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch
file /usr/share/man/man8/dnf-repoclosure.8.gz from install of dnf5-plugins-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch
file /usr/share/man/man5/dnf.conf.5.gz from install of dnf5-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-data-4.21.1-1.fc40.noarch
file /usr/share/man/man8/dnf-download.8.gz from install of dnf5-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch
file /usr/share/man/man8/dnf-system-upgrade.8.gz from install of dnf5-5.2.6.2-1.fc41.x86_64 conflicts with file from package dnf-plugins-core-4.9.0-1.fc40.noarch

You have not dome what I suggested to fix the conflicts.

sudo dnf remove ‘*dnf5*’

After that try the upgrade.

I did exactly that but the conflicts seems to be between dnf5 about to be installed and dnf4 which is already installed

The dnf-data and libdnf5 should both be updated at the same time, and then it will be conflicts free. If you remove dnf5 and libdnf5 packages, you should be able to upgrade.