Fixing duplicates detected by `dnf check` would mean removing protected packages

Hi everyone, this is a very basic question about dnf, yet I haven’t been able to find an answer.

The issue

I wanted to do some early-summer cleaning with dnf. I ran dnf check and got a long list of duplicates:

Check discovered 120 problem(s) in 120 package(s)

I learned this is a common issue arising in the case of interrupted installations.

A try at solving

Now, if I try the commands that worked for this user (Fix duplicate packages detected by `dnf check`), that is,

sudo dnf distro-sync
sudo dnf remove --duplicates

I get two errors.

1. dnf distro-sync

On sudo dnf distro-sync,

Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Problem: The operation would result in removing the following protected packages: systemd, systemd-udev
You can try to add to command line:
  --skip-broken to skip uninstallable packages

What to do? This seems to be the main problem.

2. dnf remove --duplicates

Then, on sudo dnf remove --duplicates,

Unknown argument "--duplicates" for command "remove". Add "--help" for more information about the arguments.
The argument is available for commands: check, repoquery. (It has to be placed after the command.)

It appears, this doesn’t work anymore on DNF5. An user had the same issue here (Run dnf remove --duplicates but received Unknown argument "--duplicates"), and the answer by the ubiquitous @tqcharm is marked as the solution. They say:

Does the command sudo dnf repoquery --duplicates return any packages? If it doesn’t, then there is no need to remove any.

Now, in my case this command returns a long list of packages, including the aforementioned systemd- series.


P.S.

I understand that the problems are two, and may require opening two different topics; but I reckon they stem from the same dnf check operation.

Also, can someone link to a good, up-to-date manual for DNF5?

Thanks in advance :slight_smile:

That command is only available in dnf4

sudo dnf4 remove --duplicates

The (supposedly) up-to-date manual is the man pages for dnf. Run man dnf for an overview and run man dnf-xxxxx where xxxx is one of the sub-commands, for example man dnf-install.

If they are good, I can’t tell.

There’s a bug for this: 2351369 – dnf5 does not seem to have a remove --duplicates replacement

1 Like

Assuming the system is up to date, what is the output of:

sudo dnf distro-sync --allowerasing --skip-broken --assumeno
1 Like

Thanks to @vekruse and @grumpey for the clarification on point #2.
So

sudo dnf reinstall $(dnf rq --duplicates \
    --latest-limit=1 --qf="%{name}\n")

would do the thing?

As for point #1, which is what worries me (thank you @tqcharm), the output of sudo dnf distro-sync --allowerasing --skip-broken --assumeno is once again:

Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Problem: The operation would result in removing the following protected packages: systemd, systemd-udev

Is this the dnf output of the distro-sync command when run with the flags[1] mentioned above (i.e. with allowerasing and skip-broken)?

You could also try the recommendation from this post, but replacing dnf with dnf4, as well as the release version with the proper one.


  1. Better to include the command in the outputs as well. ↩︎

Yes, that’s the output of sudo dnf distro-sync --allowerasing --skip-broken --assumeno.

What do the commands in the post you suggested do? I had a similar problem on another machine these days, and am wary of removing those protected packages.

I agree with being cautious. That’s why I suggest using the assumeno flag first, to see what the dnf command would want to remove.

Good to hear that. I already had to do a complete reinstall after removing protected packages on another machine that had the same problem.
Anyway, as I said above, sudo dnf distro-sync --allowerasing --skip-broken --assumeno would remove

the following protected packages: systemd, systemd-udev

What can I do?

Please check/share the outputs of the following commands:

$ dnf repolist
$ sudo dnf4 remove --duplicates --releasever 42 --setopt protected_packages= --assumeno
$ sudo dnf distro-sync --refresh --releasever 42 --setopt protected_packages= --assumeno
sudo dnf reinstall --setopt=protected_packages= --assumeno $(dnf rq --duplicates \
    --latest-limit=1 --qf="%{name}\n")

for duplicates with dnf5

2 Likes

1. dnf repolist

So, the output of dnf repolist:

$ dnf repolist
repo id                                                      repo name                                                              
copr:copr.fedorainfracloud.org:jerrycasiano:FontManager      Copr repo for FontManager owned by jerrycasiano                        
copr:copr.fedorainfracloud.org:phracek:PyCharm               Copr repo for PyCharm owned by phracek                                 
copr:copr.fedorainfracloud.org:zeno:scrcpy                   Copr repo for scrcpy owned by zeno                                     
fedora                                                       Fedora 42 - x86_64                                                     
fedora-cisco-openh264                                        Fedora 42 openh264 (From Cisco) - x86_64                               
google-chrome                                                google-chrome                                                          
repository                                                   LibreWolf Software Repository         
                                 
// rpm fusion packages, removed because of too many chars
                                                
sublime-text                                                 Sublime Text - x86_64 - Stable                                         
updates                                                      Fedora 42 - x86_64 - Updates                                           
updates-testing                                              Fedora 42 - x86_64 - Test Updates  

2. dnf4 remove

Instead, sudo dnf4 remove --duplicates --releasever 42 --setopt protected_packages= --assumeno aborts soon, before giving interesting info; but I won’t risk removing --assumeno before you tell me so :slight_smile:

Fedora 42 - x86_64 - Updates                                                                         12 kB/s |  11 kB     00:00    
Fedora 42 - x86_64 - Updates                                                                        669 kB/s | 1.3 MB     00:02    
Fedora 42 - x86_64 - Test Updates                                                                    35 kB/s |  22 kB     00:00    
Fedora 42 - x86_64 - Test Updates                                                                   162 kB/s | 281 kB     00:01    
LibreWolf Software Repository                                                                       2.0 kB/s | 833  B     00:00    
LibreWolf Software Repository                                                                        36 kB/s | 6.8 kB     00:00    
Importing GPG key 0x2B12EF16:
 Userid     : "LibreWolf Maintainers <gpg@librewolf.net>"
 Fingerprint: 662E 3CDD 6FE3 2900 2D0C A5BB 4033 9DD8 2B12 EF16
 From       : https://repo.librewolf.net/pubkey.gpg
LibreWolf Software Repository                                                                       2.4 kB/s | 833  B     00:00    
Error: Failed to download metadata for repo 'repository': repomd.xml GPG signature verification error: Signing key not found

3. dnf distro-sync

sudo dnf distro-sync --refresh --releasever 42 --setopt protected_packages= --assumeno, then, gives:

 // removed list of repos because of too many chars
Repositories loaded.
Package                                    Arch       Version                                    Repository                     Size
Removing dependent packages:
 NetworkManager-ssh                        x86_64     1.4.1-1.fc42                               updates-testing           222.4 KiB
 NetworkManager-ssh-gnome                  x86_64     1.4.1-1.fc42                               updates-testing           173.2 KiB
 NetworkManager-ssh-selinux                x86_64     1.4.1-1.fc42                               updates-testing            18.5 KiB
 container-selinux                         noarch     4:2.237.0-1.fc42                           <unknown>                  72.4 KiB
 coreutils                                 x86_64     9.6-3.fc42                                 <unknown>                   5.4 MiB
 coreutils-common                          x86_64     9.6-3.fc42                                 <unknown>                  11.1 MiB
 firefox                                   x86_64     138.0.4-1.fc42                             updates                   240.2 MiB
 firefox-langpacks                         x86_64     138.0.4-1.fc42                             updates                    40.6 MiB
 gnome-text-editor                         x86_64     48.2-1.fc42                                updates-testing             2.3 MiB
 gst-editing-services                      x86_64     1.26.1-1.fc42                              <unknown>                   1.4 MiB
 gstreamer1                                x86_64     1.26.1-1.fc42                              <unknown>                   5.3 MiB
 gstreamer1-plugin-libav                   x86_64     1.26.1-1.fc42                              <unknown>                 392.7 KiB
 gstreamer1-plugin-openh264                x86_64     1.26.1-1.fc42                              <unknown>                  68.3 KiB
 gstreamer1-plugins-bad-free               x86_64     1.26.1-1.fc42                              <unknown>                   8.8 MiB
 gstreamer1-plugins-bad-free-libs          x86_64     1.26.1-1.fc42                              <unknown>                   3.1 MiB
 gstreamer1-plugins-base                   x86_64     1.26.1-1.fc42                              <unknown>                   7.3 MiB
 gstreamer1-plugins-good                   x86_64     1.26.1-1.fc42                              <unknown>                   7.3 MiB
 gstreamer1-plugins-good-gtk               x86_64     1.26.1-1.fc42                              <unknown>                  64.2 KiB
 gstreamer1-plugins-good-qt                x86_64     1.26.1-1.fc42                              <unknown>                 190.4 KiB
 gstreamer1-plugins-good-qt6               x86_64     1.26.1-1.fc42                              <unknown>                 211.9 KiB
 gstreamer1-plugins-ugly-free              x86_64     1.26.1-1.fc42                              <unknown>                 630.1 KiB
 javascriptcoregtk4.1                      x86_64     2.48.2-1.fc42                              updates                    30.0 MiB
 javascriptcoregtk6.0                      x86_64     2.48.2-1.fc42                              updates                    30.0 MiB
 mesa-dri-drivers                          x86_64     25.0.6-1.fc42                              updates-testing           164.5 MiB
 mesa-filesystem                           x86_64     25.0.6-1.fc42                              updates-testing             3.6 KiB
 mesa-libEGL                               x86_64     25.0.6-1.fc42                              updates-testing           335.2 KiB
 mesa-libGL                                x86_64     25.0.6-1.fc42                              updates-testing           420.1 KiB
 mesa-libgbm                               x86_64     25.0.6-1.fc42                              updates-testing            19.7 KiB
 mesa-vulkan-drivers                       x86_64     25.0.6-1.fc42                              updates-testing           114.8 MiB
 nodejs                                    x86_64     1:22.15.1-1.fc42                           <unknown>                 156.3 KiB
 nodejs-docs                               noarch     1:22.15.1-1.fc42                           <unknown>                  94.8 MiB
 nodejs-full-i18n                          x86_64     1:22.15.1-1.fc42                           <unknown>                  30.4 MiB
 nodejs-libs                               x86_64     1:22.15.1-1.fc42                           <unknown>                  79.2 MiB
 nodejs-npm                                x86_64     1:10.9.2-1.22.15.1.1.fc42                  <unknown>                   9.3 MiB
 ptyxis                                    x86_64     48.3-2.fc42                                updates-testing             1.8 MiB
 systemd                                   x86_64     257.5-6.fc42                               updates                    12.1 MiB
 systemd-container                         x86_64     257.5-6.fc42                               updates                     2.2 MiB
 systemd-libs                              x86_64     257.5-6.fc42                               updates                     2.2 MiB
 systemd-networkd                          x86_64     257.5-6.fc42                               updates                     2.2 MiB
 systemd-oomd-defaults                     noarch     257.5-6.fc42                               updates                   187.0   B
 systemd-pam                               x86_64     257.5-6.fc42                               updates                     1.1 MiB
 systemd-resolved                          x86_64     257.5-6.fc42                               updates                   669.9 KiB
 systemd-shared                            x86_64     257.5-6.fc42                               updates                     4.6 MiB
 systemd-sysusers                          x86_64     257.5-6.fc42                               updates                    83.8 KiB
 systemd-udev                              x86_64     257.5-6.fc42                               updates                    11.9 MiB
 webkit2gtk4.1                             x86_64     2.48.2-1.fc42                              updates                    86.0 MiB
 webkitgtk6.0                              x86_64     2.48.2-1.fc42                              updates                    86.0 MiB

Transaction Summary:
 Removing:          47 packages

After this operation, 1 GiB will be freed (install 0 B, remove 1 GiB).
Operation aborted by the user.

4. dnf reinstall (as @grumpey suggests)

Finally,
sudo dnf reinstall --setopt=protected_packages= --assumeno $(dnf rq --duplicates \ --latest-limit=1 --qf="%{name}\n"), as @grumpey suggested, outputs the following:

Updating and loading repositories:
Repositories loaded.
Package                                          Arch      Version                                   Repository                 Size
Reinstalling:
 NetworkManager-ssh                              x86_64    1.4.1-2.fc42                              updates               222.4 KiB
   replacing NetworkManager-ssh                  x86_64    1.4.1-2.fc42                              <unknown>             222.4 KiB
   replacing NetworkManager-ssh                  x86_64    1.4.1-1.fc42                              updates-testing       222.4 KiB
 NetworkManager-ssh-gnome                        x86_64    1.4.1-2.fc42                              updates               173.2 KiB
   replacing NetworkManager-ssh-gnome            x86_64    1.4.1-2.fc42                              <unknown>             173.2 KiB
   replacing NetworkManager-ssh-gnome            x86_64    1.4.1-1.fc42                              updates-testing       173.2 KiB
 NetworkManager-ssh-selinux                      x86_64    1.4.1-2.fc42                              updates                18.6 KiB
   replacing NetworkManager-ssh-selinux          x86_64    1.4.1-2.fc42                              <unknown>              18.6 KiB
   replacing NetworkManager-ssh-selinux          x86_64    1.4.1-1.fc42                              updates-testing        18.5 KiB
 container-selinux                               noarch    4:2.238.0-1.fc42                          updates                72.3 KiB
   replacing container-selinux                   noarch    4:2.238.0-1.fc42                          <unknown>              72.3 KiB
   replacing container-selinux                   noarch    4:2.237.0-1.fc42                          <unknown>              72.4 KiB
 coreutils                                       x86_64    9.6-4.fc42                                updates                 5.4 MiB
   replacing coreutils                           x86_64    9.6-4.fc42                                <unknown>               5.4 MiB
   replacing coreutils                           x86_64    9.6-3.fc42                                <unknown>               5.4 MiB
 coreutils-common                                x86_64    9.6-4.fc42                                updates                11.1 MiB
   replacing coreutils-common                    x86_64    9.6-4.fc42                                <unknown>              11.1 MiB
   replacing coreutils-common                    x86_64    9.6-3.fc42                                <unknown>              11.1 MiB
 firefox                                         x86_64    139.0-1.fc42                              updates               244.7 MiB
   replacing firefox                             x86_64    139.0-1.fc42                              <unknown>             244.7 MiB
   replacing firefox                             x86_64    138.0.4-1.fc42                            updates               240.2 MiB
 firefox-langpacks                               x86_64    139.0-1.fc42                              updates                41.0 MiB
   replacing firefox-langpacks                   x86_64    139.0-1.fc42                              <unknown>              41.0 MiB
   replacing firefox-langpacks                   x86_64    138.0.4-1.fc42                            updates                40.6 MiB
 glibc                                           x86_64    2.41-6.fc42                               updates-testing         6.6 MiB
   replacing glibc                               x86_64    2.41-6.fc42                               <unknown>               6.6 MiB
   replacing glibc                               x86_64    2.41-5.fc42                               updates-testing         6.6 MiB
 glibc-all-langpacks                             x86_64    2.41-6.fc42                               updates-testing       226.9 MiB
   replacing glibc-all-langpacks                 x86_64    2.41-6.fc42                               <unknown>             226.9 MiB
   replacing glibc-all-langpacks                 x86_64    2.41-5.fc42                               updates-testing       226.9 MiB
 glibc-common                                    x86_64    2.41-6.fc42                               updates-testing         1.0 MiB
   replacing glibc-common                        x86_64    2.41-6.fc42                               <unknown>               1.0 MiB
   replacing glibc-common                        x86_64    2.41-5.fc42                               updates-testing         1.0 MiB
 glibc-devel                                     x86_64    2.41-6.fc42                               updates-testing         2.3 MiB
   replacing glibc-devel                         x86_64    2.41-6.fc42                               <unknown>               2.3 MiB
   replacing glibc-devel                         x86_64    2.41-5.fc42                               updates-testing         2.3 MiB
 glibc-gconv-extra                               x86_64    2.41-6.fc42                               updates-testing         7.2 MiB
   replacing glibc-gconv-extra                   x86_64    2.41-6.fc42                               <unknown>               7.2 MiB
   replacing glibc-gconv-extra                   x86_64    2.41-5.fc42                               updates-testing         7.2 MiB
 gnome-text-editor                               x86_64    48.3-1.fc42                               updates                 2.3 MiB
   replacing gnome-text-editor                   x86_64    48.3-1.fc42                               <unknown>               2.3 MiB
   replacing gnome-text-editor                   x86_64    48.2-1.fc42                               updates-testing         2.3 MiB
 gst-editing-services                            x86_64    1.26.2-1.fc42                             updates                 1.4 MiB
   replacing gst-editing-services                x86_64    1.26.2-1.fc42                             <unknown>               1.4 MiB
   replacing gst-editing-services                x86_64    1.26.1-1.fc42                             <unknown>               1.4 MiB
 gstreamer1                                      x86_64    1.26.2-1.fc42                             updates                 5.3 MiB
   replacing gstreamer1                          x86_64    1.26.2-1.fc42                             <unknown>               5.3 MiB
   replacing gstreamer1                          x86_64    1.26.1-1.fc42                             <unknown>               5.3 MiB
 gstreamer1-plugin-libav                         x86_64    1.26.2-1.fc42                             updates               404.5 KiB
   replacing gstreamer1-plugin-libav             x86_64    1.26.2-1.fc42                             <unknown>             404.5 KiB
   replacing gstreamer1-plugin-libav             x86_64    1.26.1-1.fc42                             <unknown>             392.7 KiB
 gstreamer1-plugin-openh264                      x86_64    1.26.2-1.fc42                             updates                68.3 KiB
   replacing gstreamer1-plugin-openh264          x86_64    1.26.2-1.fc42                             <unknown>              68.3 KiB
   replacing gstreamer1-plugin-openh264          x86_64    1.26.1-1.fc42                             <unknown>              68.3 KiB
 gstreamer1-plugins-bad-free                     x86_64    1.26.2-1.fc42                             updates                 8.9 MiB
   replacing gstreamer1-plugins-bad-free         x86_64    1.26.2-1.fc42                             <unknown>               8.9 MiB
   replacing gstreamer1-plugins-bad-free         x86_64    1.26.1-1.fc42                             <unknown>               8.8 MiB
 gstreamer1-plugins-bad-free-libs                x86_64    1.26.2-1.fc42                             updates                 3.1 MiB
   replacing gstreamer1-plugins-bad-free-libs    x86_64    1.26.2-1.fc42                             <unknown>               3.1 MiB
   replacing gstreamer1-plugins-bad-free-libs    x86_64    1.26.1-1.fc42                             <unknown>               3.1 MiB
 gstreamer1-plugins-base                         x86_64    1.26.2-1.fc42                             updates                 7.3 MiB
   replacing gstreamer1-plugins-base             x86_64    1.26.2-1.fc42                             <unknown>               7.3 MiB
   replacing gstreamer1-plugins-base             x86_64    1.26.1-1.fc42                             <unknown>               7.3 MiB
 gstreamer1-plugins-good                         x86_64    1.26.2-1.fc42                             updates                 7.3 MiB
   replacing gstreamer1-plugins-good             x86_64    1.26.2-1.fc42                             <unknown>               7.3 MiB
   replacing gstreamer1-plugins-good             x86_64    1.26.1-1.fc42                             <unknown>               7.3 MiB
 gstreamer1-plugins-good-gtk                     x86_64    1.26.2-1.fc42                             updates                64.2 KiB
   replacing gstreamer1-plugins-good-gtk         x86_64    1.26.2-1.fc42                             <unknown>              64.2 KiB
   replacing gstreamer1-plugins-good-gtk         x86_64    1.26.1-1.fc42                             <unknown>              64.2 KiB
 gstreamer1-plugins-good-qt                      x86_64    1.26.2-1.fc42                             updates               190.4 KiB
   replacing gstreamer1-plugins-good-qt          x86_64    1.26.2-1.fc42                             <unknown>             190.4 KiB
   replacing gstreamer1-plugins-good-qt          x86_64    1.26.1-1.fc42                             <unknown>             190.4 KiB
 gstreamer1-plugins-good-qt6                     x86_64    1.26.2-1.fc42                             updates               211.9 KiB
   replacing gstreamer1-plugins-good-qt6         x86_64    1.26.2-1.fc42                             <unknown>             211.9 KiB
   replacing gstreamer1-plugins-good-qt6         x86_64    1.26.1-1.fc42                             <unknown>             211.9 KiB
 gstreamer1-plugins-ugly-free                    x86_64    1.26.2-1.fc42                             updates               641.0 KiB
   replacing gstreamer1-plugins-ugly-free        x86_64    1.26.2-1.fc42                             <unknown>             641.0 KiB
   replacing gstreamer1-plugins-ugly-free        x86_64    1.26.1-1.fc42                             <unknown>             630.1 KiB
 javascriptcoregtk4.1                            x86_64    2.48.3-1.fc42                             updates                30.0 MiB
   replacing javascriptcoregtk4.1                x86_64    2.48.3-1.fc42                             <unknown>              30.0 MiB
   replacing javascriptcoregtk4.1                x86_64    2.48.2-1.fc42                             updates                30.0 MiB
 javascriptcoregtk6.0                            x86_64    2.48.3-1.fc42                             updates                30.0 MiB
   replacing javascriptcoregtk6.0                x86_64    2.48.3-1.fc42                             <unknown>              30.0 MiB
   replacing javascriptcoregtk6.0                x86_64    2.48.2-1.fc42                             updates                30.0 MiB
 librewolf                                       x86_64    139.0.1-1                                 repository            358.9 MiB
   replacing librewolf                           x86_64    139.0.1-1                                 <unknown>             358.9 MiB
   replacing librewolf                           x86_64    138.0.4-1                                 <unknown>             352.7 MiB
 mesa-dri-drivers                                x86_64    25.0.7-1.fc42                             updates               164.5 MiB
   replacing mesa-dri-drivers                    x86_64    25.0.7-1.fc42                             <unknown>             164.5 MiB
   replacing mesa-dri-drivers                    x86_64    25.0.6-1.fc42                             updates-testing       164.5 MiB
 mesa-filesystem                                 x86_64    25.0.7-1.fc42                             updates                 3.6 KiB
   replacing mesa-filesystem                     x86_64    25.0.7-1.fc42                             <unknown>               3.6 KiB
   replacing mesa-filesystem                     x86_64    25.0.6-1.fc42                             updates-testing         3.6 KiB
 mesa-libEGL                                     x86_64    25.0.7-1.fc42                             updates               335.2 KiB
   replacing mesa-libEGL                         x86_64    25.0.7-1.fc42                             <unknown>             335.2 KiB
   replacing mesa-libEGL                         x86_64    25.0.6-1.fc42                             updates-testing       335.2 KiB
 mesa-libGL                                      x86_64    25.0.7-1.fc42                             updates               420.1 KiB
   replacing mesa-libGL                          x86_64    25.0.7-1.fc42                             <unknown>             420.1 KiB
   replacing mesa-libGL                          x86_64    25.0.6-1.fc42                             updates-testing       420.1 KiB
 mesa-libgbm                                     x86_64    25.0.7-1.fc42                             updates                19.7 KiB
   replacing mesa-libgbm                         x86_64    25.0.7-1.fc42                             <unknown>              19.7 KiB
   replacing mesa-libgbm                         x86_64    25.0.6-1.fc42                             updates-testing        19.7 KiB
 mesa-vulkan-drivers                             x86_64    25.0.7-1.fc42                             updates               114.8 MiB
   replacing mesa-vulkan-drivers                 x86_64    25.0.7-1.fc42                             <unknown>             114.8 MiB
   replacing mesa-vulkan-drivers                 x86_64    25.0.6-1.fc42                             updates-testing       114.8 MiB
 mozjs128                                        x86_64    128.11.0-1.fc42                           updates                19.1 MiB
   replacing mozjs128                            x86_64    128.11.0-1.fc42                           <unknown>              19.1 MiB
   replacing mozjs128                            x86_64    128.8.1-1.fc42                            updates-testing        19.1 MiB
 nodejs                                          x86_64    1:22.16.0-1.fc42                          updates               154.4 KiB
   replacing nodejs                              x86_64    1:22.16.0-1.fc42                          <unknown>             154.4 KiB
   replacing nodejs                              x86_64    1:22.15.1-1.fc42                          <unknown>             156.3 KiB
 nodejs-docs                                     noarch    1:22.16.0-1.fc42                          updates                95.6 MiB
   replacing nodejs-docs                         noarch    1:22.16.0-1.fc42                          <unknown>              95.6 MiB
   replacing nodejs-docs                         noarch    1:22.15.1-1.fc42                          <unknown>              94.8 MiB
 nodejs-full-i18n                                x86_64    1:22.16.0-1.fc42                          updates                30.4 MiB
   replacing nodejs-full-i18n                    x86_64    1:22.16.0-1.fc42                          <unknown>              30.4 MiB
   replacing nodejs-full-i18n                    x86_64    1:22.15.1-1.fc42                          <unknown>              30.4 MiB
 nodejs-libs                                     x86_64    1:22.16.0-1.fc42                          updates                79.1 MiB
   replacing nodejs-libs                         x86_64    1:22.16.0-1.fc42                          <unknown>              79.1 MiB
   replacing nodejs-libs                         x86_64    1:22.15.1-1.fc42                          <unknown>              79.2 MiB
 nodejs-npm                                      x86_64    1:10.9.2-1.22.16.0.1.fc42                 updates                 9.3 MiB
   replacing nodejs-npm                          x86_64    1:10.9.2-1.22.16.0.1.fc42                 <unknown>               9.3 MiB
   replacing nodejs-npm                          x86_64    1:10.9.2-1.22.15.1.1.fc42                 <unknown>               9.3 MiB
 ptyxis                                          x86_64    48.4-2.fc42                               updates                 1.8 MiB
   replacing ptyxis                              x86_64    48.4-2.fc42                               <unknown>               1.8 MiB
   replacing ptyxis                              x86_64    48.3-2.fc42                               updates-testing         1.8 MiB
 systemd                                         x86_64    257.6-1.fc42                              updates                12.1 MiB
   replacing systemd                             x86_64    257.6-1.fc42                              <unknown>              12.1 MiB
   replacing systemd                             x86_64    257.5-6.fc42                              updates                12.1 MiB
 systemd-container                               x86_64    257.6-1.fc42                              updates                 2.2 MiB
   replacing systemd-container                   x86_64    257.6-1.fc42                              <unknown>               2.2 MiB
   replacing systemd-container                   x86_64    257.5-6.fc42                              updates                 2.2 MiB
 systemd-libs                                    x86_64    257.6-1.fc42                              updates                 2.2 MiB
   replacing systemd-libs                        x86_64    257.6-1.fc42                              <unknown>               2.2 MiB
   replacing systemd-libs                        x86_64    257.5-6.fc42                              updates                 2.2 MiB
 systemd-networkd                                x86_64    257.6-1.fc42                              updates                 2.2 MiB
   replacing systemd-networkd                    x86_64    257.6-1.fc42                              <unknown>               2.2 MiB
   replacing systemd-networkd                    x86_64    257.5-6.fc42                              updates                 2.2 MiB
 systemd-oomd-defaults                           noarch    257.6-1.fc42                              updates               187.0   B
   replacing systemd-oomd-defaults               noarch    257.6-1.fc42                              <unknown>             187.0   B
   replacing systemd-oomd-defaults               noarch    257.5-6.fc42                              updates               187.0   B
 systemd-pam                                     x86_64    257.6-1.fc42                              updates                 1.1 MiB
   replacing systemd-pam                         x86_64    257.6-1.fc42                              <unknown>               1.1 MiB
   replacing systemd-pam                         x86_64    257.5-6.fc42                              updates                 1.1 MiB
 systemd-resolved                                x86_64    257.6-1.fc42                              updates               669.9 KiB
   replacing systemd-resolved                    x86_64    257.6-1.fc42                              <unknown>             669.9 KiB
   replacing systemd-resolved                    x86_64    257.5-6.fc42                              updates               669.9 KiB
 systemd-shared                                  x86_64    257.6-1.fc42                              updates                 4.6 MiB
   replacing systemd-shared                      x86_64    257.6-1.fc42                              <unknown>               4.6 MiB
   replacing systemd-shared                      x86_64    257.5-6.fc42                              updates                 4.6 MiB
 systemd-sysusers                                x86_64    257.6-1.fc42                              updates                83.8 KiB
   replacing systemd-sysusers                    x86_64    257.6-1.fc42                              <unknown>              83.8 KiB
   replacing systemd-sysusers                    x86_64    257.5-6.fc42                              updates                83.8 KiB
 systemd-udev                                    x86_64    257.6-1.fc42                              updates                12.0 MiB
   replacing systemd-udev                        x86_64    257.6-1.fc42                              <unknown>              12.0 MiB
   replacing systemd-udev                        x86_64    257.5-6.fc42                              updates                11.9 MiB
 webkit2gtk4.1                                   x86_64    2.48.3-1.fc42                             updates                86.0 MiB
   replacing webkit2gtk4.1                       x86_64    2.48.3-1.fc42                             <unknown>              86.0 MiB
   replacing webkit2gtk4.1                       x86_64    2.48.2-1.fc42                             updates                86.0 MiB
 webkitgtk6.0                                    x86_64    2.48.3-1.fc42                             updates                86.0 MiB
   replacing webkitgtk6.0                        x86_64    2.48.3-1.fc42                             <unknown>              86.0 MiB
   replacing webkitgtk6.0                        x86_64    2.48.2-1.fc42                             updates                86.0 MiB

Transaction Summary:
 Reinstalling:      54 packages
 Replacing:        108 packages

Total size of inbound packages is 444 MiB. Need to download 444 MiB.
After this operation, 2 GiB will be freed (install 2 GiB, remove 3 GiB).
Operation aborted by the user.

Which one should I go for, then? #4 seems the most secure option. Thank you again, in advance!

All -assumeno does is to automatically reply with no when asked to confirm the dnf operation (as to not accidentally confirm with yes).

You have updates-testing repo enabled. If this is intended, and you need packages from the testing repo for whatever reason, then that’s fine. If not, then I would disable that repo before trying to fix the issue.

From what I can see, the dnf reinstall command, as indicated by Joe, reinstalls systemd packages, so it seems safe to run it, just make sure once again no packages will be removed.

Afterwards, you can run the dnf distro-sync command with the -assumeno flag first, but I suspect the output will be different and won’t propose relevant packages for removal, given the previous command fixing duplicates. If true, you can go ahead with this command as well.

1 Like

dnf reinstall (command #4) worked! (dnf distro-sync ... says Nothing to do, and dnf check gives no output anymore.

I marked yours as the solution, since it recapitulates the discussion better, for newcomers. But thanks a lot to Joe, too!


Any ideas on why this happened originally? It might be because of an interrupted update. But then, shouldn’t dnf be able to take care of this in an easier way?

2 Likes

Glad to hear it’s fixed now.

An interrupted update, issues with system-upgrades from older versions, maybe some issues with transitioning from dnf4 to dnf5 could cause duplicate packages on the system.

2 Likes