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
- take a EL9 or EL10 container
- dnf install cockpit-system
- 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.