Can I safely remove `dnf-3` and `dnf4` on Fedora 41?

I recently updated to Fedora 41, and my dnf points to dnf5.

I recommend not doing that based on what else would be removed

Removing:
 python3-dnf                                             noarch        4.22.0-1.fc41                                            updates-testing                  2.6 MiB
Removing dependent packages:
 dnf-plugins-core                                        noarch        4.10.0-1.fc41                                            updates-testing                 22.7 KiB
 dnf-utils                                               noarch        4.10.0-1.fc41                                            updates-testing                 21.3 KiB
 fedrq                                                   noarch        1.4.0-1.fc41                                             updates-testing                771.7 KiB
 python3-dnf-plugins-core                                noarch        4.10.0-1.fc41                                            updates-testing                  1.2 MiB
 setroubleshoot                                          x86_64        3.3.34-1.fc41                                            updates-testing                186.8 KiB
Removing unused dependencies:
 at-spi2-atk                                             i686          2.54.0-1.fc41                                            updates-testing                292.5 KiB
 augeas-libs                                             x86_64        1.14.2-0.1.20240903git2de06e0.fc41                       fedora                           1.2 MiB
 avahi-glib                                              i686          0.8-29.fc41                                              fedora                          18.9 KiB
 cairo-gobject                                           i686          1.18.0-4.fc41                                            fedora                          30.5 KiB
 colord-libs                                             i686          1.4.7-5.fc41                                             fedora                         863.4 KiB
 dnf-data                                                noarch        4.22.0-1.fc41                                            updates-testing                 38.6 KiB
 duktape                                                 i686          2.7.0-8.fc41                                             fedora                         615.4 KiB
 fedora-repos-rawhide                                    noarch        41-1                                                     updates-testing                  2.2 KiB
 gdk-pixbuf2-modules                                     i686          2.42.12-6.fc41                                           fedora                          54.1 KiB
 glib-networking                                         i686          2.80.0-4.fc41                                            fedora                         723.7 KiB
 gstreamer1                                              i686          1.24.9-1.fc41                                            updates                          5.7 MiB
 gtk3                                                    i686          3.24.43-2.fc41                                           fedora                          23.4 MiB
 json-glib                                               i686          1.10.0-1.fc41                                            updates-testing                569.6 KiB
 lcms2                                                   i686          2.16-4.fc41                                              fedora                         463.2 KiB
 libXcomposite                                           i686          0.4.6-4.fc41                                             fedora                          43.8 KiB
 libXcursor                                              i686          1.2.3-1.fc41                                             updates-testing                 56.8 KiB
 libXdamage                                              i686          1.1.6-4.fc41                                             fedora                          43.0 KiB
 libXinerama                                             i686          1.1.5-7.fc41                                             fedora                          18.3 KiB
 libcanberra                                             i686          0.30-36.fc41                                             fedora                         266.0 KiB
 libcanberra-gtk3                                        i686          0.30-36.fc41                                             fedora                          68.8 KiB
 libcloudproviders                                       i686          0.3.5-5.fc41                                             fedora                         123.5 KiB
 libgusb                                                 i686          0.4.9-2.fc41                                             fedora                         161.4 KiB
 libicu                                                  i686          74.2-2.fc41                                              fedora                          35.3 MiB
 libproxy                                                i686          0.5.8-1.fc41                                             fedora                         108.9 KiB
 libreport                                               x86_64        2.17.15-3.fc41                                           fedora                           2.6 MiB
 libreport-gtk                                           x86_64        2.17.15-3.fc41                                           fedora                         208.3 KiB
 libreport-plugin-reportuploader                         x86_64        2.17.15-3.fc41                                           fedora                         102.0 KiB
 libreport-web                                           x86_64        2.17.15-3.fc41                                           fedora                          56.5 KiB
 libsoup3                                                i686          3.6.0-1.fc41                                             fedora                           1.2 MiB
 libtdb                                                  i686          1.4.12-3.fc41                                            updates-testing                104.4 KiB
 libtracker-sparql                                       i686          3.7.3-3.fc41                                             fedora                           1.1 MiB
 libunwind                                               i686          1.8.0-5.fc41                                             updates-testing                173.1 KiB
 libwayland-cursor                                       i686          1.23.0-2.fc41                                            fedora                          32.4 KiB
 libwayland-egl                                          i686          1.23.0-2.fc41                                            fedora                          15.8 KiB
 libxkbcommon                                            i686          1.7.0-4.fc41                                             fedora                         343.0 KiB
 python3-annotated-types                                 noarch        0.7.0-3.fc41                                             fedora                          80.3 KiB
 python3-dasbus                                          noarch        1.7-8.fc41                                               fedora                         401.4 KiB
 python3-dns                                             noarch        2.6.1-4.fc41                                             fedora                           2.8 MiB
 python3-email-validator                                 noarch        2.2.0-3.fc41                                             fedora                         172.3 KiB
 python3-libreport                                       x86_64        2.17.15-3.fc41                                           fedora                         489.1 KiB
 python3-libxml2                                         x86_64        2.12.8-2.fc41                                            fedora                           1.3 MiB
 python3-pydantic                                        noarch        2.9.2-1.fc41                                             updates-testing                  4.4 MiB
 python3-pydantic+email                                  noarch        2.9.2-1.fc41                                             updates-testing                147.1 KiB
 python3-pydantic-core                                   x86_64        2.23.4-2.fc41                                            updates-testing                  4.9 MiB
 python3-systemd                                         x86_64        235-11.fc41                                              fedora                         356.5 KiB
 python3-unbound                                         x86_64        1.21.1-1.fc41                                            updates-testing                521.8 KiB
 rpm-plugin-systemd-inhibit                              x86_64        4.20.0-1.fc41                                            updates-testing                 16.3 KiB
 satyr                                                   x86_64        0.43-4.fc41                                              fedora                         339.4 KiB
 setroubleshoot-plugins                                  noarch        3.3.14-10.fc41                                           fedora                           2.5 MiB
 setroubleshoot-server

If you really want to try it, I would do it in a VM before trying it on a working machine.

4 Likes

I removed the legacy DNF packages right after upgrading to Fedora 41 and it works fine.
As my setup is quite minimalistic, most of the packages listed above were not even installed.
The premise is that you understand what you are doing and know how to undo it if something goes wrong.

1 Like

So these packages need dnf-4? In the following I don’t want to remove so many packages (for e.g. zenity):

$ sudo dnf remove  python3-dnf-4.21.1-2.fc41.noarch 
Package                                      Arch        Version                                      Repository                   Size
Removing:
 python3-dnf                                 noarch      4.21.1-2.fc41                                updates                   2.6 MiB
Removing dependent packages:
 abrt-cli                                    x86_64      2.17.6-2.fc41                                <unknown>                 0.0   B
 abrt-desktop                                x86_64      2.17.6-2.fc41                                <unknown>                 0.0   B
 abrt-java-connector                         x86_64      1.3.2-6.fc40                                 fedora                   93.9 KiB
 anaconda                                    x86_64      41.35-2.fc41                                 <unknown>                 0.0   B
 anaconda-live                               noarch      41.35-2.fc41                                 <unknown>                24.5 KiB
 dnf-plugins-core                            noarch      4.9.0-1.fc41                                 <unknown>                22.7 KiB
 dnf-utils                                   noarch      4.9.0-1.fc41                                 <unknown>                21.3 KiB
 kdump-anaconda-addon                        noarch      006-12.20220714git7ca2d3e.fc41               <unknown>               164.8 KiB
 python3-dnf-plugins-core                    noarch      4.9.0-1.fc41                                 <unknown>                 1.2 MiB
 remove-retired-packages                     noarch      41.1-1.fc41                                  <unknown>                22.9 KiB
Removing unused dependencies:
 NetworkManager-team                         x86_64      1:1.50.0-1.fc41                              <unknown>                56.1 KiB
 abrt                                        x86_64      2.17.6-2.fc41                                <unknown>                 2.7 MiB
 abrt-addon-ccpp                             x86_64      2.17.6-2.fc41                                <unknown>               300.3 KiB
 abrt-addon-kerneloops                       x86_64      2.17.6-2.fc41                                <unknown>                95.5 KiB
 abrt-addon-pstoreoops                       x86_64      2.17.6-2.fc41                                <unknown>                18.8 KiB
 abrt-addon-vmcore                           x86_64      2.17.6-2.fc41                                <unknown>                37.2 KiB
 abrt-addon-xorg                             x86_64      2.17.6-2.fc41                                <unknown>                65.9 KiB
 abrt-dbus                                   x86_64      2.17.6-2.fc41                                <unknown>               164.5 KiB
 abrt-gui                                    x86_64      2.17.6-2.fc41                                <unknown>               102.0 KiB
 abrt-gui-libs                               x86_64      2.17.6-2.fc41                                <unknown>                35.9 KiB
 abrt-libs                                   x86_64      2.17.6-2.fc41                                <unknown>                68.9 KiB
 abrt-plugin-bodhi                           x86_64      2.17.6-2.fc41                                <unknown>                43.6 KiB
 abrt-tui                                    noarch      2.17.6-2.fc41                                <unknown>                79.2 KiB
 anaconda-core                               x86_64      41.35-2.fc41                                 <unknown>                13.0 MiB
 anaconda-gui                                x86_64      41.35-2.fc41                                 <unknown>                 2.9 MiB
 anaconda-tui                                x86_64      41.35-2.fc41                                 <unknown>               480.7 KiB
 anaconda-widgets                            x86_64      41.35-2.fc41                                 <unknown>                94.4 KiB
 augeas-libs                                 x86_64      1.14.2-0.1.20240903git2de06e0.fc41           <unknown>                 1.2 MiB
 blivet-data                                 noarch      1:3.11.0-3.fc41                              <unknown>               474.8 KiB
 blivet-gui-runtime                          noarch      2.5.0-4.fc41                                 <unknown>                 1.5 MiB
 dbus-x11                                    x86_64      1:1.14.10-4.fc41                             <unknown>                36.0 KiB
 dnf-data                                    noarch      4.21.1-2.fc41                                updates                  38.3 KiB
 elfutils                                    x86_64      0.192-5.fc41                                 updates                   2.7 MiB
 gnome-abrt                                  x86_64      1.4.3-3.fc41                                 <unknown>               544.4 KiB
 libcomps                                    x86_64      0.1.21-3.fc41                                <unknown>               205.4 KiB
 libreport                                   x86_64      2.17.15-3.fc41                               <unknown>                 2.6 MiB
 libreport-anaconda                          x86_64      2.17.15-3.fc41                               <unknown>                19.2 KiB
 libreport-cli                               x86_64      2.17.15-3.fc41                               <unknown>                41.1 KiB
 libreport-fedora                            x86_64      2.17.15-3.fc41                               <unknown>                53.5 KiB
 libreport-gtk                               x86_64      2.17.15-3.fc41                               <unknown>               208.3 KiB
 libreport-plugin-bugzilla                   x86_64      2.17.15-3.fc41                               <unknown>               128.3 KiB
 libreport-plugin-kerneloops                 x86_64      2.17.15-3.fc41                               <unknown>                44.0 KiB
 libreport-plugin-logger                     x86_64      2.17.15-3.fc41                               <unknown>                51.9 KiB
 libreport-plugin-reportuploader             x86_64      2.17.15-3.fc41                               <unknown>               102.0 KiB
 libreport-plugin-systemd-journal            x86_64      2.17.15-3.fc41                               <unknown>                25.3 KiB
 libreport-plugin-ureport                    x86_64      2.17.15-3.fc41                               <unknown>                80.6 KiB
 libreport-web                               x86_64      2.17.15-3.fc41                               <unknown>                56.5 KiB
 python3-abrt                                x86_64      2.17.6-2.fc41                                <unknown>                75.7 KiB
 python3-abrt-addon                          noarch      2.17.6-2.fc41                                <unknown>                18.2 KiB
 python3-augeas                              noarch      1.1.0-14.fc41                                <unknown>                95.7 KiB
 python3-blivet                              noarch      1:3.11.0-3.fc41                              <unknown>                 4.5 MiB
 python3-blockdev                            x86_64      3.2.1-1.fc41                                 updates                 131.2 KiB
 python3-bytesize                            x86_64      2.11-99.fc41                                 <unknown>                53.9 KiB
 python3-dasbus                              noarch      1.7-8.fc41                                   <unknown>               401.4 KiB
 python3-hawkey                              x86_64      0.73.3-1.fc41                                <unknown>               306.3 KiB
 python3-humanize                            noarch      4.9.0-2.fc41                                 <unknown>               213.5 KiB
 python3-iso639                              noarch      0.1.4-27.fc41                                <unknown>                25.4 KiB
 python3-kickstart                           noarch      3.58-3.fc41                                  <unknown>                 3.2 MiB
 python3-libcomps                            x86_64      0.1.21-3.fc41                                <unknown>               143.4 KiB
 python3-libdnf                              x86_64      0.73.3-1.fc41                                <unknown>                 3.8 MiB
 python3-libmount                            x86_64      2.40.2-4.fc41                                <unknown>               120.8 KiB
 python3-libreport                           x86_64      2.17.15-3.fc41                               <unknown>               489.1 KiB
 python3-meh                                 noarch      0.52-3.fc41                                  <unknown>               309.7 KiB
 python3-meh-gui                             noarch      0.52-3.fc41                                  <unknown>                30.3 KiB
 python3-pid                                 noarch      2.2.3-23.fc41                                <unknown>                40.8 KiB
 python3-productmd                           noarch      1.41-1.fc41                                  updates                 346.5 KiB
 python3-pwquality                           x86_64      1.4.5-11.fc41                                <unknown>                25.5 KiB
 python3-pyparted                            x86_64      1:3.13.0-7.fc41                              <unknown>               403.8 KiB
 python3-requests-file                       noarch      2.0.0-4.fc41                                 <unknown>                14.0 KiB
 python3-requests-ftp                        noarch      0.3.1-35.fc41                                <unknown>                38.1 KiB
 python3-satyr                               x86_64      0.43-4.fc41                                  <unknown>               118.0 KiB
 python3-simpleline                          noarch      1.9.0-12.fc41                                <unknown>               476.7 KiB
 python3-systemd                             x86_64      235-11.fc41                                  <unknown>               356.5 KiB
 python3-unbound                             x86_64      1.21.1-1.fc41                                <unknown>               521.8 KiB
 python3-xkbregistry                         x86_64      0.3-3.fc41                                   <unknown>               100.8 KiB
 rpm-plugin-systemd-inhibit                  x86_64      4.20.0-1.fc41                                <unknown>                16.3 KiB
 satyr                                       x86_64      0.43-4.fc41                                  <unknown>               339.4 KiB
 tigervnc-license                            noarch      1.14.1-2.fc41                                updates                  17.6 KiB
 tigervnc-server-minimal                     x86_64      1.14.1-2.fc41                                updates                   2.8 MiB
 xisxwayland                                 x86_64      2-5.fc41                                     <unknown>                17.0 KiB
 xmlrpc-c                                    x86_64      1.59.03-2.fc41                               <unknown>               505.2 KiB
 xmlrpc-c-client                             x86_64      1.59.03-2.fc41                               <unknown>                55.9 KiB
 zenity                                      x86_64      4.0.3-1.fc41                                 <unknown>                10.6 MiB

Transaction Summary:
 Removing:          84 packages

Is this ok [y/N]:        

None of those packages are vital.
If you actually need zenity, it can be marked as user-installed:

sudo dnf mark user zenity

Otherwise it’s just a dependency subjected to auto-removal.

1 Like

You can run dnf5 with --no-autoremove. That would keep the packages listed under “Removing unused dependencies:”. The equivalent spelling in dnf4 is --noautoremove.

1 Like