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

dnf tries (and fails) to remove protected packages that were installed as a dependency

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • CentOS Stream 9, CentOS Stream 10, rhel-9.5
    • dnf
    • No
    • None
    • rhel-sst-cs-software-management
    • ssg_core_services
    • 8
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

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

      Uninstall a package that I have installed previously

      What is the impact of this issue to you?

      Breaks automation

      Please provide the package NVR for which the bug is seen:

      dnf-4.20.0-9.el10.noarch

      dnf-4.14.0-21.el9.noarch

      dnf5-5.2.8.1-3.fc41.x86_64

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. take a EL9 or EL10 container
      2. dnf install cockpit-system
      3. dnf remove cockpit-system

      Expected results

      cockpit-system and the dependencies that were installed for it are removed, if some of the dependencies are protected, those remain but the overall removal works

      Actual results

      Error: 
       Problem: The operation would result in removing the following protected packages: grub2-tools-minimal, sudo, systemd-udev
      (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

      Additional information

      This happens not only with cockpit and grub, but with every dependency chain that contains a protected package that would be removed as nothing else depends on it anymore, cockpit/grub is just taken here as an example as it's trivial to reproduce in a minimal container.

      This also happens on Fedora 41 with dnf5 – e.g. using the fedora:41 container, installing container-selinux which pulls in the protected selinux-policy-targeted and then trying to remove container-selinux again.

              packaging-team-maint packaging-team-maint
              egolov@redhat.com Evgeni Golov
              packaging-team-maint packaging-team-maint
              Software Management QE Software Management QE
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: