Bug 1192811

Summary: dnf whatprovides should show which provides matched a pattern
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 26CC: ahmadsamir3891, akozumpl, cristian.ciupitu, digitalroot3, germano.massullo, jmracek, jzeleny, michal.jnn, mluscon, opensource, packaging-team-maint, pnemade, redhat.com, rlpowell, spital, tim.lauridsen, travneff
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-2.7.2-1.fc27 dnf-2.7.2-1.fc26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-04 14:23:48 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:
Bug Depends On: 879233    
Bug Blocks:    

Description Till Maas 2015-02-15 14:09:56 UTC
Description of problem:
dnf does not show how which result matched, this makes it harder to figure out which package one actually wants to install:

$ LANG=C dnf whatprovides \*/makebst\*
texlive-custom-bib-doc-4:svn24729.4.33-1.1.fc21.noarch : Documentation for custom-bib
Repo        : fedora

texlive-custom-bib-4:svn24729.4.33-1.1.fc21.noarch : Customised BibTeX styles
Repo        : fedora

yum shows it like this:
$ LANG=C yum whatprovides \*/makebst\*
Loaded plugins: etckeeper, langpacks
4:texlive-custom-bib-svn24729.4.33-1.1.fc21.noarch : Customised BibTeX styles
Repo        : fedora
Matched from:
Filename    : /usr/share/texlive/texmf-dist/tex/latex/custom-bib/makebst.tex



4:texlive-custom-bib-doc-svn24729.4.33-1.1.fc21.noarch : Documentation for custom-bib
Repo        : fedora
Matched from:
Filename    : /usr/share/texlive/texmf-dist/doc/latex/custom-bib/makebst.pdf


Version-Release number of selected component (if applicable):
dnf-0.6.3-2.fc21

Comment 1 Radek Holy 2015-02-16 13:11:00 UTC
Hello, thank you for the report. First of all it seems that you are using an unsupported feature since DNF's documentation does not mention any "whatprovides" command. Looking at the code it seems that this is an alias for the "provides" command.

We should consider adding the alias to the documentation.

And back to the problem itself. The change you are requesting is not as simple as you might expected. Actually, IIRC, DNF passes the query down to libsolv and actually libsolv returns back *packages*, not the provides. So we should either change a lot of DNF's and hawkey's code base or implement a (I'd say) workaround that iterates over all the package (file)provides again on the DNF's level and matches the pattern again to provide the output.

So, I'm not saying that we are not going to do that but I think the priority is not so high since particularly in your case, I believe that the package info provides enough information to choose which package you want. We'd welcome other examples in which the package info is not enough to make a proper decision.

Comment 2 Till Maas 2015-02-16 22:08:31 UTC
I knew I also saw this issue when I tried to find a tool that was also bundled in private directories of a lot of packages. I do not remember it currently. But one other example where the output is not so helpful is for example: dnf provides \*/*rehash - or more or less all cases, where the actual name of the tool is not completely known.

Comment 3 Honza Silhan 2015-03-04 14:12:32 UTC
The idea is to implement hawkey.Query().run_by_provides() method that would return [(pkg1, prov1), ...]

Comment 4 Ahmad Samir 2015-04-12 16:01:57 UTC
This and bug 1084171 are duplicates.

Comment 5 Till Maas 2015-04-12 19:05:17 UTC
*** Bug 1084171 has been marked as a duplicate of this bug. ***

Comment 6 Robin Powell 2015-06-22 18:41:51 UTC
FWIW, this is a big deal for me.  In the few days since I've upgraded to F22, I've been upset about the lack of this data at least 3 times.

Here's a list of examples.  The first one actually *requires* dnf to provide this functionality, i.e. I know of no workaround (although maybe you can share one with me).  The others are "just" a matter of dnf breaking my workflow that I've been using for years, which certainly matters to me but I suppose isn't critical.

- I'm using mariadb, but I want "service mysql restart" to work; where does the mysqld service file normally live? (not solvable with rpm -ql, as I don't have the package in question installed, nor am I going to)
- Puppet installs a default site.pp file, but I've mucked with its config extensively; where does that config file normally live? (solvable with rpm -ql)
- I had to delete a cache directory; what package normally provides that directory?  (dnf's responses work well enough for this purpose)

Comment 7 Honza Silhan 2015-07-15 09:02:23 UTC
*** Bug 1243327 has been marked as a duplicate of this bug. ***

Comment 8 Robin Powell 2015-09-17 18:02:19 UTC
I'm tempted to post a comment every time this annoys me.  :)

More usefully: I know *nothing* about the relevant codebases, but if someone wants to give me some pointers I could take a look; this really cramps my style.

Comment 9 Fedora End Of Life 2015-11-04 10:18:57 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Andrew 2015-11-04 13:43:02 UTC
Still present, as far as I see. Could anybody switch the Fedora version to 23?

Comment 11 Michal Luscon 2015-11-30 12:37:58 UTC
*** Bug 1286113 has been marked as a duplicate of this bug. ***

Comment 12 digitalr00ts 2016-03-22 07:06:11 UTC
@Radek Holy
Being able to see the path and file from the output of 'yum provides' is very helpful. DNF is not as easy to use if it does not have this feature.

My use case on how I got here:

# dnf provides /*sepolicy
policycoreutils-devel-2.2.5-20.el7.x86_64 : SELinux policy core policy devel utilities
Repo        : @System

policycoreutils-python-2.2.5-20.el7.x86_64 : SELinux policy core python utilities
Repo        : @System

policycoreutils-devel-2.2.5-20.el7.i686 : SELinux policy core policy devel utilities
Repo        : base

policycoreutils-devel-2.2.5-20.el7.x86_64 : SELinux policy core policy devel utilities
Repo        : base

policycoreutils-python-2.2.5-20.el7.x86_64 : SELinux policy core python utilities
Repo        : base


'dnf info' does not help me. 'yum provides' shows me that policycoreutils-devel has the /usr/bin/sepolicy file.

Comment 13 Fedora Admin XMLRPC Client 2016-07-08 09:34:37 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 14 Germano Massullo 2017-01-20 11:16:46 UTC
Let's think about the following example: I want to know what package provides sqlite3 executable, so I run
# dnf provides sqlite3
but dnf says that there are no matches.
Instead if I run
# dnf provides /usr/bin/sqlite3
then it works and it returns
sqlite-3.14.2-1.fc25.x86_64 : Library that implements an embeddable SQL database engine
Repo         : @System

sqlite-3.14.2-1.fc25.i686 : Library that implements an embeddable SQL database engine
Repo         : fedora

sqlite-3.14.2-1.fc25.x86_64 : Library that implements an embeddable SQL database engine
Repo         : fedora



If I remember correctly, "yum provides" worked good even without passing the whole executable path as input.

Comment 15 Fedora End Of Life 2017-02-28 09:41:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 16 Jaroslav Mracek 2017-08-31 12:28:47 UTC
I create a patch that should provide additional information for command "provides" (https://github.com/rpm-software-management/dnf/pull/915).

Comment 17 Robin Powell 2017-08-31 15:44:47 UTC
Oh thank you thank you thank you!

Comment 18 Fedora Update System 2017-10-02 10:35:06 UTC
dnf-plugins-extras-2.0.3-1.fc27 dnf-plugins-core-2.1.4-1.fc27 dnf-2.7.2-1.fc27 libdnf-0.10.1-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-faf235c683

Comment 19 Fedora Update System 2017-10-02 10:38:16 UTC
dnf-plugins-extras-2.0.3-1.fc26 dnf-plugins-core-2.1.4-1.fc26 dnf-2.7.2-1.fc26 libdnf-0.10.1-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-70a8618065

Comment 20 Fedora Update System 2017-10-02 20:28:54 UTC
dnf-2.7.2-1.fc26, dnf-plugins-core-2.1.4-1.fc26, dnf-plugins-extras-2.0.3-1.fc26, libdnf-0.10.1-1.fc26 has been pushed to the Fedora 26 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-2017-70a8618065

Comment 21 Fedora Update System 2017-10-02 21:28:09 UTC
dnf-2.7.2-1.fc27, dnf-plugins-core-2.1.4-1.fc27, dnf-plugins-extras-2.0.3-1.fc27, libdnf-0.10.1-1.fc27 has been pushed to the Fedora 27 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-2017-faf235c683

Comment 22 Robin Powell 2017-10-03 06:26:06 UTC
EEEE! THIS MAKES ME SO HAPPY THANK YOU!!

Comment 23 Fedora Update System 2017-10-04 14:23:48 UTC
dnf-2.7.2-1.fc27, dnf-plugins-core-2.1.4-1.fc27, dnf-plugins-extras-2.0.3-1.fc27, libdnf-0.10.1-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2017-10-04 22:25:50 UTC
dnf-2.7.2-1.fc26, dnf-plugins-core-2.1.4-1.fc26, dnf-plugins-extras-2.0.3-1.fc26, libdnf-0.10.1-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.