Bug 1279066

Summary: RFE: dnf don't mark running kernel for removal
Product: [Fedora] Fedora Reporter: Marc Muehlfeld <rh>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 23CC: jsilhan, mluscon, packaging-team-maint, pnemade, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-09 16:57:47 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 Marc Muehlfeld 2015-11-07 16:26:25 UTC
Description of problem:
The command "dnf remove kernel", removes all kernel - including the one, that is currently active. Before F21 and also in RHEL, all kernels will be removed - except the current one. This behaviour should be back, to prevent uninstalling all kernels and can't boot any more.



Version-Release number of selected component (if applicable):
dnf-1.1.3-1.fc23.noarch



How reproducible:
Always.



Steps to Reproduce:
1. Have at least two kernel packages installed on your system.
2. Run "dnf remove kernel"



Actual results:
dnf offers to remove all kernel packages - including the one that is currently active.



Expected results:
dnf should skip the current active kernel for removal (like it was before F21 and also is in RHEL)



Additional info:
This bug was already reported for yum in Fedora 21 (Bug #1175532), but this one was closed, because F21 is EOL. I opened a new one, because meanwhile it's dnf and not yum any more.

Comment 1 Honza Silhan 2015-11-09 14:07:29 UTC
The running kernel is never removed - protected_packages from dnf-plugins-core component reports it and halts the operation.

Comment 2 Marc Muehlfeld 2015-11-09 16:57:47 UTC
I digged a bit deeper and find out, that the "kernel" package doesn't contain any files (any more?):

# rpm -qlp kernel-4.2.5-300.fc23.x86_64.rpm 
(enthält keine Dateien)    -> in english: contains no files

I don't understand the sense of a package without files, but this shouldn't be part of this request :-)

The kernel is inside the package kernel-core. And for that, Jan's reply is correct. The active Kernel isn't removed:

# dnf remove kernel-core
Abhängigkeiten sind aufgelöst.
Fehler: The operation would result in removing the booted kernel: kernel-core-4.2.5-300.fc23.x86_64.

Sorry for the noise. I set the status to NOTABUG.