Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-27937

Missing ability to dnf autoremove weak dependencies

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • None
    • Moderate
    • rhel-swm
    • ssg_core_services
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • All
    • None

      What were you trying to do that didn't work?

      Automatically remove all packages that are neither user-installed nor transitively Required by any user-installed package (i.e. what dnf autoremove is supposed to do).

      Please provide the package NVR for which bug is seen:

      dnf-4.7.0-19.el8 in particular, but the same appears to be true for RHEL 9 (and in dnf master from looking at the code).

      How reproducible:

      Always, since this is a missing feature rather than a strict bug.

      Steps to reproduce

      1. Configure 'install_weak_deps=False'
      2. Install package A which 'Requires: C', pulling in C as a dependency.
      3. Install package B which 'Recommends: C'
      4. Remove package A
      5. Run a dnf autoremove

      Expected results

      There should be some way to configure dnf autoremove to ignore weak dependencies, resulting in C being automatically removed.

      Actual results

      There is no such ability; the weak requirement of B on C will prevent it from ever being autoremoved.

      This means that the 'install_weak_deps=False' config option is insufficient to prevent weak dependencies from sneaking into the system. It really feels like there should be a mirror option like 'retain_weak_deps=False' or 'autoremove_weak_deps=True' to allow cleaning up (or install_weak_deps should directly apply to autoremove, but that's a change in behaviour).

      Workarounds like iterating over all packages in the system to manually identify such cases are not scalable.

              Unassigned Unassigned
              chris-riches-redhat Chris Riches (Inactive)
              Nutanix Confidential Group
              packaging-team-maint packaging-team-maint
              Software Management QE Software Management QE
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: