#2 Removing anaconda with pkcon will not remove 160MB of dependencies
Closed by kparal. Opened by kparal.

In remove-anaconda.sh, anaconda is removed using pkcon. Unfortunately, that won't remove a load of dependencies, which anaconda brings. It only saves about 15 MB instead of 176 MB (and the extra packages also waste bandwidth and slow down future system updates).

This is what pkcon does:

[kparal@f36 ~]$ pkcon remove anaconda-core anaconda-dracut anaconda-install-env-deps anaconda-install-img-deps
Resolving                     [=========================]         Package not found: anaconda-dracut
                              [=========================]         Package not found: anaconda-install-img-deps
                              [=========================]         
Finished                      [                         ] (0%)  
The following packages have to be removed:
 anaconda-36.16.5-2.fc36.x86_64 Graphical system installer
 anaconda-core-36.16.5-2.fc36.x86_64    Core of the Anaconda installer
 anaconda-gui-36.16.5-2.fc36.x86_64 Graphical user interface for the Anaconda installer
 anaconda-install-env-deps-36.16.5-2.fc36.x86_64    Installation environment specific dependencies
 anaconda-live-36.16.5-2.fc36.x86_64    Live installation specific files and dependencies
 anaconda-tui-36.16.5-2.fc36.x86_64 Textual user interface for the Anaconda installer
 kdump-anaconda-addon-006-6.20220128git9603258.fc36.noarch  Kdump configuration anaconda addon
Proceed with changes? [N/y]

And this is what dnf does:

[kparal@f36 ~]$ sudo dnf remove anaconda-core anaconda-dracut anaconda-install-env-deps anaconda-install-img-deps
No match for argument: anaconda-dracut
No match for argument: anaconda-install-img-deps
Dependencies resolved.
==============================================================================================================================
 Package                              Architecture      Version                                    Repository            Size
==============================================================================================================================
Removing:
 anaconda-core                        x86_64            36.16.5-2.fc36                             @updates              11 M
 anaconda-install-env-deps            x86_64            36.16.5-2.fc36                             @updates               0  
Removing dependent packages:
 anaconda                             x86_64            36.16.5-2.fc36                             @updates               0  
 anaconda-live                        x86_64            36.16.5-2.fc36                             @updates              25 k
 kdump-anaconda-addon                 noarch            006-6.20220128git9603258.fc36              @anaconda            165 k
Removing unused dependencies:
 NetworkManager-team                  x86_64            1:1.38.0-1.fc36                            @updates              48 k
 anaconda-gui                         x86_64            36.16.5-2.fc36                             @updates             2.5 M
 anaconda-tui                         x86_64            36.16.5-2.fc36                             @updates             376 k
 anaconda-user-help                   noarch            26.2-2.fc36                                @anaconda            577 k
 anaconda-widgets                     x86_64            36.16.5-2.fc36                             @updates              97 k
 bcache-tools                         x86_64            1.1-2.fc36                                 @anaconda            157 k
 binutils                             x86_64            2.37-27.fc36                               @updates              33 M
 binutils-gold                        x86_64            2.37-27.fc36                               @updates             1.9 M
 blivet-data                          noarch            1:3.4.4-1.fc36                             @updates             440 k
 blivet-gui-runtime                   noarch            2.3.0-5.fc36                               @anaconda            1.2 M
 createrepo_c                         x86_64            0.20.0-1.fc36                              @updates             201 k
 createrepo_c-libs                    x86_64            0.20.0-1.fc36                              @updates             262 k
 cxl-libs                             x86_64            73-1.fc36                                  @anaconda            103 k
 dbus-x11                             x86_64            1:1.14.0-1.fc36                            @anaconda             36 k
 drpm                                 x86_64            0.5.1-1.fc36                               @anaconda            128 k
 gcc                                  x86_64            12.1.1-1.fc36                              @updates              91 M
 gcc-gdb-plugin                       x86_64            12.1.1-1.fc36                              @updates             336 k
 gdb                                  x86_64            12.1-1.fc36                                @updates             410 k
 glibc-devel                          x86_64            2.35-11.fc36                               @updates              97 k
 glibc-headers-x86                    noarch            2.35-11.fc36                               @updates             2.1 M
 iniparser                            x86_64            4.1-9.fc36                                 @anaconda             27 k
 isomd5sum                            x86_64            1:1.2.3-15.fc36                            @anaconda             59 k
 kernel-headers                       x86_64            5.17.11-300.fc36                           @updates             5.7 M
 keybinder3                           x86_64            0.3.2-13.fc36                              @anaconda             32 k
 libblockdev-btrfs                    x86_64            2.27-1.fc36                                @updates              27 k
 libblockdev-dm                       x86_64            2.27-1.fc36                                @updates              23 k
 libblockdev-kbd                      x86_64            2.27-1.fc36                                @updates              35 k
 libblockdev-lvm                      x86_64            2.27-1.fc36                                @updates              60 k
 libblockdev-lvm-dbus                 x86_64            2.27-1.fc36                                @updates              76 k
 libblockdev-mpath                    x86_64            2.27-1.fc36                                @updates              23 k
 libblockdev-nvdimm                   x86_64            2.27-1.fc36                                @updates              23 k
 libblockdev-plugins-all              x86_64            2.27-1.fc36                                @updates               0  
 libreport-anaconda                   x86_64            2.17.1-1.fc36                              @anaconda             19 k
 libtimezonemap                       x86_64            0.4.5.1-11.fc36                            @anaconda            6.7 M
 libxcrypt-devel                      x86_64            4.4.28-1.fc36                              @anaconda             30 k
 lvm2-dbusd                           noarch            2.03.11-7.fc36                             @anaconda            427 k
 make                                 x86_64            1:4.3-7.fc36                               @anaconda            1.6 M
 ndctl                                x86_64            73-1.fc36                                  @anaconda            351 k
 python3-blivet                       noarch            1:3.4.4-1.fc36                             @updates             3.4 M
 python3-blockdev                     x86_64            2.27-1.fc36                                @updates              83 k
 python3-bytesize                     x86_64            2.7-1.fc36                                 @updates              40 k
 python3-dasbus                       noarch            1.6-4.fc36                                 @anaconda            338 k
 python3-kickstart                    noarch            3.36-1.fc36                                @anaconda            2.5 M
 python3-langtable                    noarch            0.0.58-1.fc36                              @updates             1.3 M
 python3-meh                          noarch            0.50-5.fc36                                @anaconda            288 k
 python3-meh-gui                      noarch            0.50-5.fc36                                @anaconda             24 k
 python3-pid                          noarch            2.2.3-13.fc36                              @anaconda             35 k
 python3-productmd                    noarch            1.33-4.fc36                                @anaconda            256 k
 python3-pwquality                    x86_64            1.4.4-7.fc36                               @anaconda             26 k
 python3-pyparted                     x86_64            1:3.12.0-1.fc36                            @anaconda            372 k
 python3-pyudev                       noarch            0.22.0-8.fc36                              @anaconda            315 k
 python3-requests-file                noarch            1.5.1-5.fc36                               @anaconda            9.9 k
 python3-requests-ftp                 noarch            0.3.1-24.fc36                              @anaconda             36 k
 python3-simpleline                   noarch            1.9.0-2.fc36                               @anaconda            437 k
 tigervnc-license                     noarch            1.12.0-6.fc36                              @updates              18 k
 tigervnc-server-minimal              x86_64            1.12.0-6.fc36                              @updates             2.8 M
 tmux                                 x86_64            3.2a-3.fc36                                @anaconda            1.1 M
 udisks2-iscsi                        x86_64            2.9.4-4.fc36                               @anaconda             56 k
 usermode                             x86_64            1.114-4.fc36                               @anaconda            836 k
 xisxwayland                          x86_64            1-3.fc36                                   @anaconda             17 k
Transaction Summary
==============================================================================================================================
Remove  65 Packages
Freed space: 176 M
Is this ok [y/N]: 

Is it possible to use dnf for the transaction? Or use pkcon, but run dnf autoremove afterwards? That would result in this:

[kparal@f36 ~]$ sudo dnf autoremove
Last metadata expiration check: 96 days, 22:26:43 ago on Thu 02 Jun 2022 11:34:43 AM CEST.
Dependencies resolved.
==============================================================================================================================
 Package                                Architecture          Version                          Repository                Size
==============================================================================================================================
Removing:
 NetworkManager-team                    x86_64                1:1.38.0-1.fc36                  @updates                  48 k
 anaconda-user-help                     noarch                26.2-2.fc36                      @anaconda                577 k
 anaconda-widgets                       x86_64                36.16.5-2.fc36                   @updates                  97 k
 bcache-tools                           x86_64                1.1-2.fc36                       @anaconda                157 k
 binutils                               x86_64                2.37-27.fc36                     @updates                  33 M
 binutils-gold                          x86_64                2.37-27.fc36                     @updates                 1.9 M
 blivet-data                            noarch                1:3.4.4-1.fc36                   @updates                 440 k
 blivet-gui-runtime                     noarch                2.3.0-5.fc36                     @anaconda                1.2 M
 createrepo_c                           x86_64                0.20.0-1.fc36                    @updates                 201 k
 createrepo_c-libs                      x86_64                0.20.0-1.fc36                    @updates                 262 k
 cxl-libs                               x86_64                73-1.fc36                        @anaconda                103 k
 dbus-x11                               x86_64                1:1.14.0-1.fc36                  @anaconda                 36 k
 drpm                                   x86_64                0.5.1-1.fc36                     @anaconda                128 k
 gcc                                    x86_64                12.1.1-1.fc36                    @updates                  91 M
 gcc-gdb-plugin                         x86_64                12.1.1-1.fc36                    @updates                 336 k
 gdb                                    x86_64                12.1-1.fc36                      @updates                 410 k
 glibc-devel                            x86_64                2.35-11.fc36                     @updates                  97 k
 glibc-headers-x86                      noarch                2.35-11.fc36                     @updates                 2.1 M
 iniparser                              x86_64                4.1-9.fc36                       @anaconda                 27 k
 isomd5sum                              x86_64                1:1.2.3-15.fc36                  @anaconda                 59 k
 kernel-headers                         x86_64                5.17.11-300.fc36                 @updates                 5.7 M
 keybinder3                             x86_64                0.3.2-13.fc36                    @anaconda                 32 k
 libblockdev-btrfs                      x86_64                2.27-1.fc36                      @updates                  27 k
 libblockdev-dm                         x86_64                2.27-1.fc36                      @updates                  23 k
 libblockdev-kbd                        x86_64                2.27-1.fc36                      @updates                  35 k
 libblockdev-lvm                        x86_64                2.27-1.fc36                      @updates                  60 k
 libblockdev-lvm-dbus                   x86_64                2.27-1.fc36                      @updates                  76 k
 libblockdev-mpath                      x86_64                2.27-1.fc36                      @updates                  23 k
 libblockdev-nvdimm                     x86_64                2.27-1.fc36                      @updates                  23 k
 libblockdev-plugins-all                x86_64                2.27-1.fc36                      @updates                   0  
 libreport-anaconda                     x86_64                2.17.1-1.fc36                    @anaconda                 19 k
 libtimezonemap                         x86_64                0.4.5.1-11.fc36                  @anaconda                6.7 M
 libxcrypt-devel                        x86_64                4.4.28-1.fc36                    @anaconda                 30 k
 lvm2-dbusd                             noarch                2.03.11-7.fc36                   @anaconda                427 k
 make                                   x86_64                1:4.3-7.fc36                     @anaconda                1.6 M
 ndctl                                  x86_64                73-1.fc36                        @anaconda                351 k
 python3-blivet                         noarch                1:3.4.4-1.fc36                   @updates                 3.4 M
 python3-blockdev                       x86_64                2.27-1.fc36                      @updates                  83 k
 python3-bytesize                       x86_64                2.7-1.fc36                       @updates                  40 k
 python3-dasbus                         noarch                1.6-4.fc36                       @anaconda                338 k
 python3-kickstart                      noarch                3.36-1.fc36                      @anaconda                2.5 M
 python3-langtable                      noarch                0.0.58-1.fc36                    @updates                 1.3 M
 python3-meh                            noarch                0.50-5.fc36                      @anaconda                288 k
 python3-meh-gui                        noarch                0.50-5.fc36                      @anaconda                 24 k
 python3-pid                            noarch                2.2.3-13.fc36                    @anaconda                 35 k
 python3-productmd                      noarch                1.33-4.fc36                      @anaconda                256 k
 python3-pwquality                      x86_64                1.4.4-7.fc36                     @anaconda                 26 k
 python3-pyparted                       x86_64                1:3.12.0-1.fc36                  @anaconda                372 k
 python3-pyudev                         noarch                0.22.0-8.fc36                    @anaconda                315 k
 python3-requests-file                  noarch                1.5.1-5.fc36                     @anaconda                9.9 k
 python3-requests-ftp                   noarch                0.3.1-24.fc36                    @anaconda                 36 k
 python3-simpleline                     noarch                1.9.0-2.fc36                     @anaconda                437 k
 tigervnc-license                       noarch                1.12.0-6.fc36                    @updates                  18 k
 tigervnc-server-minimal                x86_64                1.12.0-6.fc36                    @updates                 2.8 M
 tmux                                   x86_64                3.2a-3.fc36                      @anaconda                1.1 M
 udisks2-iscsi                          x86_64                2.9.4-4.fc36                     @anaconda                 56 k
 usermode                               x86_64                1.114-4.fc36                     @anaconda                836 k
 xisxwayland                            x86_64                1-3.fc36                         @anaconda                 17 k
Transaction Summary
==============================================================================================================================
Remove  58 Packages
Freed space: 161 M
Is this ok [y/N]:

Does pkcon --autoremove remove fix this? I added that in 06745770c7db841cd0ccca22e9427c5d3a2bf525.

Oh, great, it does fix it! If only it was mentioned in the man page...

Metadata Update from @kparal:
- Issue status updated to: Closed (was: Open)

@kparal Feel free to submit a patch upstream. :smile:

Metadata