Dnf update fails due to file conflict in systemd-networkd between installed and new version

I have only updated via dnf update. Now I can dowload everything and start the update, but it fails with the following:

Transaction failed: Rpm transaction failed.

  • file /usr/lib/systemd/systemd-network-generator from install of systemd-networkd-257.9-2.fc42.x86_64 conflicts with file from package systemd-udev-257.7-1.fc42.x86_64
  • file /usr/share/man/man8/systemd-network-generator.service.8.gz from install of systemd-networkd-257.9-2.fc42.x86_64 conflicts with file from package systemd-udev-257.7-1.fc42.x86_64

Can’t remove systemd-networkd-257.7 because it’s protected, I’ve done dnf autoremove, dnf clean, dnf list package-cleanup, dnf update –allowerasing all with no result.

Am at a bit of a loss where to go from here? Any ideas

Are there more lines explaining why not all systemd sub-packages are updated at the same time?

systemd-udev and systemd-networkd should both have been part of the update transaction.

No, what I’ve posted is the only issue, glad you think it’s odd, because so do I!!

I’m experiencing the same issue. I’m running sudo dnf update, and it wants to:

 Installing:         3 packages
 Upgrading:        166 packages
 Replacing:        168 packages

But it fails with this error:

Running transaction
Transaction failed: Rpm transaction failed.
  - file /usr/lib/systemd/systemd-network-generator from install of systemd-networkd-257.9-2.fc42.x86_64 conflicts with file from package systemd-udev-257.7-1.fc42.x86_64
  - file /usr/share/man/man8/systemd-network-generator.service.8.gz from install of systemd-networkd-257.9-2.fc42.x86_64 conflicts with file from package systemd-udev-257.7-1.fc42.x86_64

I have reported 2397579 – file conflict between systemd-udev and systemd-networkd

Thank you

I solved this by running a command I found here: Fixing duplicates detected by `dnf check` would mean removing protected packages - #12 by kiruna.

This is the command:

sudo dnf distro-sync --refresh --releasever 42 --setopt protected_packages=

I don’t understand what it does. But it worked for me at least. But use it at your own risk.

Hmm didn’t work on my system

I ran sudo dnf check and it showed me that I had a lot of duplicated packages installed with different versions numbers. Didn’t know prior that it could happen. Maybe you can run that command and perhaps it will give you some clue about what’s wrong?

Fixed it, you gave me the hint Daniel.

I installed all the non-troublesome packages. Then I did as you suggested:

sudo dnf4 check –duplicates

This gave me a rather short list including the troublesome package systemd and some updated packages that had apparently installed faultlessly. Then I ran:

sudo dnf4 remove –duplicates

this then successfully installed everything. So job done, back upto date

1 Like

Awesome!