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 1769788

Summary: dnf autoremove tries to remove kernel
Product: [Fedora] Fedora Reporter: Lukas Brabec <lbrabec>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: dmach, jmracek, jrohel, kparal, mblaha, mhatina, packaging-team-maint, pkratoch, ricky.tigg, rpm-software-management, uor3ee, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-09 07:11:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Brabec 2019-11-07 13:34:20 UTC
I tried to reproduce bug reported on r/Fedora (https://www.reddit.com/r/Fedora/comments/dsv563/something_tells_me_this_isnt_supposed_to_happen), the original reporter on reddit saw a prompt to actually remove all kernels, for the bug I encountered see below.


After clean installation of Fedora 31, "dnf autoremove" will result in output:

$ sudo dnf autoremove
...
Dependencies resolved.
Nothing to do.
Complete!



Output after running "dnf update kernel" and reboot:

$ sudo dnf autoremove
Last metadata expiration check: 0:02:52 ago on Thu 07 Nov 2019 02:12:03 PM CET.
Error: 
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages)



Output after "dnf update" and reboot:

$ sudo dnf autoremove
Last metadata expiration check: 0:07:42 ago on Thu 07 Nov 2019 02:12:03 PM CET.
Error: 
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages)




Contents of /etc/dnf/dnf.conf

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=False
skip_if_unavailable=True




Version-Release number of selected component (if applicable):
dnf-4.2.9-5.fc31.noarch
rpm-4.15.0-6.fc31.x86_64
kernel-5.3.7-301.fc31.x86_64
kernel-5.3.8-300.fc31.x86_64
kernel-core-5.3.7-301.fc31.x86_64
kernel-core-5.3.8-300.fc31.x86_64
kernel-headers-5.3.6-300.fc31.x86_64
kernel-modules-5.3.7-301.fc31.x86_64
kernel-modules-5.3.8-300.fc31.x86_64
kernel-modules-extra-5.3.7-301.fc31.x86_64
kernel-modules-extra-5.3.8-300.fc31.x86_64



How reproducible:
Always


Steps to Reproduce:
1. Clean install from F31 Workstation Live
2. dnf update kernel
3. reboot
4. dnf autoremove

Comment 1 Pavla Kratochvilova 2019-11-11 13:16:41 UTC
*** Bug 1769632 has been marked as a duplicate of this bug. ***

Comment 2 Jaroslav Mracek 2019-11-13 18:28:58 UTC
With cooperation with Dan Mach we created patches (https://github.com/rpm-software-management/dnf/pull/1529) that resolve the issue.

As a workaround I would recommend to mark kernel and kernel-core as user-installed packages (dnf mark install kernel kernel-core).

Comment 3 Jaroslav Mracek 2019-11-22 07:31:00 UTC
*** Bug 1774975 has been marked as a duplicate of this bug. ***

Comment 4 Fedora Update System 2019-12-02 14:39:12 UTC
FEDORA-2019-0d122cc67a has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-0d122cc67a

Comment 5 Fedora Update System 2019-12-02 14:39:13 UTC
FEDORA-2019-1635fee8f5 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1635fee8f5

Comment 6 Fedora Update System 2019-12-03 00:53:52 UTC
dnf-4.2.17-1.fc31, dnf-plugins-core-4.0.12-1.fc31, libcomps-0.1.12-1.fc31, libdnf-0.39.1-1.fc31, microdnf-3.3.0-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-1635fee8f5

Comment 7 Fedora Update System 2019-12-03 01:33:44 UTC
dnf-4.2.17-1.fc30, dnf-plugins-core-4.0.12-1.fc30, libcomps-0.1.12-1.fc30, libdnf-0.39.1-1.fc30, microdnf-3.3.0-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-0d122cc67a

Comment 8 Kamil Páral 2019-12-03 10:48:28 UTC
Lukas, can you please verify? Thanks.

Comment 9 Fedora Update System 2019-12-04 07:52:50 UTC
FEDORA-2019-1635fee8f5 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1635fee8f5

Comment 10 Fedora Update System 2019-12-04 08:04:16 UTC
FEDORA-2019-0d122cc67a has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-0d122cc67a

Comment 11 Fedora Update System 2019-12-05 01:23:28 UTC
dnf-4.2.17-1.fc31, dnf-plugins-core-4.0.12-1.fc31, libcomps-0.1.14-1.fc31, libdnf-0.39.1-1.fc31, microdnf-3.3.0-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-1635fee8f5

Comment 12 Fedora Update System 2019-12-05 02:00:37 UTC
dnf-4.2.17-1.fc30, dnf-plugins-core-4.0.12-1.fc30, libcomps-0.1.14-1.fc30, libdnf-0.39.1-1.fc30, microdnf-3.3.0-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-0d122cc67a

Comment 13 Fedora Update System 2019-12-06 05:44:02 UTC
dnf-4.2.17-1.fc31, dnf-plugins-core-4.0.12-1.fc31, libcomps-0.1.14-1.fc31, libdnf-0.39.1-1.fc31, microdnf-3.3.0-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Lukas Brabec 2019-12-09 07:11:11 UTC
fixed by FEDORA-2019-1635fee8f5

Comment 15 Pavla Kratochvilova 2019-12-17 12:50:34 UTC
*** Bug 1782470 has been marked as a duplicate of this bug. ***

Comment 16 Fedora Update System 2020-01-07 01:51:30 UTC
dnf-4.2.17-1.fc30, dnf-plugins-core-4.0.12-1.fc30, libcomps-0.1.14-1.fc30, libdnf-0.39.1-1.fc30, microdnf-3.3.0-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.