Bug 1087063

Summary: dnf remove syslog results in ~600 packages 1.9GB proposed for removal
Product: [Fedora] Fedora Reporter: Chris Murphy <bugzilla>
Component: dnfAssignee: Ales Kozumplik <akozumpl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: akozumpl, jzeleny, pmatilai, pnemade, rholy, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-15 07:48:50 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
debugdata.tar
none
shell output none

Description Chris Murphy 2014-04-13 17:41:34 UTC
Description of problem: When asking dnf to remove non-existent package syslog, it proposes removing ~600 packages totalling ~2GB, which would result in a completely broken system.


Version-Release number of selected component (if applicable):
dnf-0.4.20-1.fc20.noarch
hawkey-0.4.12-1.fc20.x86_64

How reproducible:
Always

Steps to Reproduce:
1. dnf remove syslog


Actual results:
Remove  578 Packages
Installed size: 1.9 G
Is this ok [y/N]: n


Expected results:
# dnf remove hello
No match for argument: hello
Error: No packages marked for removal.


Additional info:
# rpm -q syslog
package syslog is not installed

So? If it's not installed why are 578 completely unrelated packages proposed for removal?

Comment 1 Chris Murphy 2014-04-13 17:42:42 UTC
Created attachment 885897 [details]
debugdata.tar

Comment 2 Chris Murphy 2014-04-13 17:46:13 UTC
Created attachment 885898 [details]
shell output

Shell output from commands
# rpm -q syslog
# dnf remove hello
# dnf --debugsolver remove syslog

Comment 3 Panu Matilainen 2014-04-14 06:13:11 UTC
Yum behaves the same except that it eventually quits with "Error: Trying to remove "systemd", which is protected". So both yum and dnf accept remove by provides and not just name and other NEVRA combos:
 
[root@localhost ~]# rpm -q --whatprovides syslog
rsyslog-7.4.8-1.fc20.x86_64
systemd-208-15.fc20.x86_64

It does seem like strange and non-intuitive behavior to me too. Removal by provides might be handy sometimes but perhaps that should require a specific enabler switch or such.

Comment 4 Ales Kozumplik 2014-04-14 08:53:07 UTC
Upstream commit a4ca8bf targets this, 'dnf remove' will no longer search provides.

This is experimental and documented to differ from yum in cli_vs_yum.rst. If there's a couple of people complaining about this, I can point them here. If there's a lot of them we'll have to revert.

Comment 5 Ales Kozumplik 2014-04-15 07:48:50 UTC
Discussed this on #yum yesterday, we have to revert the patch, it makes the CLI inconsistent. Also see upstream commit 660c3e5.

Comment 6 Panu Matilainen 2014-04-15 08:14:44 UTC
There are inconsistencies in the  CLI with the current behavior as well. With the install/erase syslog example from the commit message in mind:

---
[root@localhost ~]# dnf install syslog
Package rsyslog-7.4.8-1.fc20.x86_64 is already installed, skipping.
Resolving dependencies
--> Starting dependency resolution
--> Finished dependency resolution
Dependencies resolved.
Nothing to do.
[root@localhost ~]# dnf remove syslog
[...]
Remove  720 Packages

Installed size: 2.4 G
Is this ok [y/N]: n

Exiting on user Command
[root@localhost ~]# [root@localhost ~]# dnf remove rsyslog
Resolving dependencies
--> Starting dependency resolution
--> Finding unneeded leftover dependencies
---> Package rsyslog.x86_64 7.4.8-1.fc20 will be erased
--> Finished dependency resolution
Dependencies resolved.

===============================================================================
 Package          Arch            Version               Repository        Size
===============================================================================
Removing:
 rsyslog          x86_64          7.4.8-1.fc20          @System          1.9 M

Transaction Summary
===============================================================================
Remove  1 Package

Installed size: 1.9 M
Is this ok [y/N]:
---

In the install case, "syslog" resolves to rsyslog only, but in the erase case it resolves to both rsyslog and systemd, resulting half the system to be erased.

It might make it less confusing if dnf at least outputed something when its operating on virtual provide instead of package name, as package names are what people *usually* are expecting to work with. Just my 5c.