Bug 1750201

Summary: dnf autoremove lists installed kernels
Product: [Fedora] Fedora Reporter: electricpbr
Component: dnfAssignee: rpm-software-management
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-09 08:33:24 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:
Attachments:
Description Flags
dnf.log none

Description electricpbr 2019-09-09 03:01:56 UTC
Created attachment 1612976 [details]
dnf.log

Description of problem:
On a fresh install with only an upgrade performed, using `dnf autoremove` marks the kernel and related packages for removal. The output of `dnf list --autoremove` is as follows:

Autoremove Packages
ebtables-compat.x86_64                   2.0.10-36.fc30                @updates 
ebtables-services.x86_64                 2.0.10-36.fc30                @updates 
kernel.x86_64                            5.0.9-301.fc30                @anaconda
kernel.x86_64                            5.2.11-200.fc30               @updates 
kernel-core.x86_64                       5.0.9-301.fc30                @anaconda
kernel-core.x86_64                       5.2.11-200.fc30               @updates 
kernel-modules.x86_64                    5.0.9-301.fc30                @anaconda
kernel-modules.x86_64                    5.2.11-200.fc30               @updates 
kernel-modules-extra.x86_64              5.0.9-301.fc30                @anaconda
kernel-modules-extra.x86_64              5.2.11-200.fc30               @updates 

Version-Release number of selected component (if applicable):
dnf-0:4.2.8-1.fc30

How reproducible:
Able to replicate on physical hardware (Thinkpad T440S) and within a VM (VirtualBox), using both the latest Fedora 30 live media and net-install.

Steps to Reproduce:
1. Perform fresh install
2. Run `dnf upgrade` upon first boot
3. Run `dnf autoremove`

Actual results:
Error: 
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages)

Expected results:
Appropriately handle orphans of user-installed packages which have been removed, if found.

Additional info:
Output of `dnf history`:
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     2 | upgrade                  | 2019-09-08 18:44 | I, O, U        |  741 EE
     1 |                          | 2019-04-25 19:24 | Install        | 1632 EE

I have also attached logs from dnf.

Comment 1 Marek Blaha 2019-09-09 08:33:24 UTC

*** This bug has been marked as a duplicate of bug 1741381 ***