Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
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:
Blocks: 1697963
TreeView+ depends on / blocked
 
Reported: 2019-04-09 16:54 UTC by Andrei Stepanov
Modified: 2023-09-12 03:35 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-12 03:35:06 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.