RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1698145 - dnf protects certain packages in container, when it should not
Summary: dnf protects certain packages in container, when it should not
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.2
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: rc
: 8.0
Assignee: Pavla Kratochvilova
QA Contact: Eva Mrakova
Mariya Pershina
URL:
Whiteboard:
Depends On: 1887911 1887916
Blocks: 1697963
TreeView+ depends on / blocked
 
Reported: 2019-04-09 16:54 UTC by Andrei Stepanov
Modified: 2023-09-15 00:16 UTC (History)
6 users (show)

Fixed In Version: dnf-4.4.2-2.el8
Doc Type: Enhancement
Doc Text:
.The `protect_running_kernel` configuration option is now available. With this update, the `protect_running_kernel` configuration option for the `dnf` and `microdnf` commands has been introduced. This option controls whether the package corresponding to the running version of the kernel is protected from removal. As a result, the user can now disable protection of the running kernel.
Clone Of:
Environment:
Last Closed: 2021-05-18 15:00:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 1 Jaroslav Mracek 2019-04-15 14:32:33 UTC
I am sorry but the protection of packages is a feature of dnf. For your user case I would recommend to use "rpm -e kernel kernel-core kernel-modules" or "rpm -e $(dnf repoquery kernel* -q --installed)" commands for a kernel case. To disable protection it also helps to use "--setopt=protected_packages=''", then the systemd could be removed, but not a running kernel. Hope that it helps.

Comment 2 Andrei Stepanov 2019-04-15 15:01:20 UTC
Jaroslav Mracek 

I see bug. And bug is: DNF behaves differently in various namespaces.
Action of DNF is not consistent. For specific example check original bug-report.
We have ci-system. Where main tools id DNF. Of course we can set various `special conditions`. But this is local solution. And more and more people will bump into this.
Please make aware DNF of different namespaces.
Currently DNF is not ready to work in containers.

Comment 3 Daniel Mach 2019-04-29 11:17:11 UTC
We could use systemd-detect-virt to detect if we're inside a container.
Also if we're working with an installroot that is different (realpath!) to '/' we could also allow removing kernel.

Comment 20 errata-xmlrpc 2021-05-18 15:00:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dnf bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1657

Comment 21 Red Hat Bugzilla 2023-09-15 00:16:30 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


Note You need to log in before you can comment on or make changes to this bug.