Bug 1396192

Summary: Print message if package is already installed when installing package by provides
Product: [Fedora] Fedora Reporter: Pat Riehecky <riehecky>
Component: dnfAssignee: rpm-software-management
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: rawhideCC: csieh, misterbonnie, mluscon, packaging-team-maint, pmatilai, pnemade, rpm-software-management, vmukhame
Target Milestone: ---Keywords: FutureFeature, Triaged, UserExperience
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-21 12:22:32 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:

Description Pat Riehecky 2016-11-17 17:24:53 UTC
Description of problem:
When using DNF to determine if a "package" is installed doesn't consider any RPM provides.  This can lead to some odd behavior in config management tools as well as user actions.

Version-Release number of selected component (if applicable):dnf-2.0.0-0.rc1.4.fc26


How reproducible:100%


Steps to Reproduce:
1. Install Fedora
2. rpm -q --provides systemd (should provide 'syslog')
3. dnf list installed syslog (shows not installed)
4. dnf install syslog (result is 'Nothing to do.')

Actual results:
[root@fdeebbd6f397 /]# dnf list installed syslog
Last metadata expiration check: 0:05:39 ago on Thu Nov 17 17:18:26 2016.
Error: No matching Packages to list
[root@fdeebbd6f397 /]# dnf install syslog
Last metadata expiration check: 0:05:43 ago on Thu Nov 17 17:18:26 2016.
<snip>
Transaction Summary
================================================================================
Skip  5 Packages

Nothing to do.
Complete!
[root@fdeebbd6f397 /]# 

Expected results:
'dnf list installed' should also consider RPM provides

Additional info:

Comment 1 Panu Matilainen 2016-11-18 07:47:10 UTC
Eek, heck no. Provides are provides and should remain hidden unless specifically asked for, just like with rpm and yum and...

Dnf could be more informative than the rather terrible "nothing to do" message however, it could explain WHY, eg:

"syslog is already installed (provided by systemd)"

Comment 2 Igor Gnatenko 2016-11-21 12:22:32 UTC
actually we already print message:
$ sudo dnf install syslog
[sudo] password for brain: 
Last metadata expiration check: 0:00:00 ago on Mon Nov 21 13:17:27 2016 CET.
Package systemd-231-11.fc26.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!