Bug 1296625 - [RFE] dnf repoquery --recursive with same functionality as in yum
[RFE] dnf repoquery --recursive with same functionality as in yum
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core (Show other bugs)
Unspecified Unspecified
low Severity unspecified
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: EasyFix, FutureFeature, Triaged
Depends On:
  Show dependency treegraph
Reported: 2016-01-07 11:49 EST by Petr Spacek
Modified: 2017-04-24 07:19 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 12:40:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Spacek 2016-01-07 11:49:13 EST
dnf repoquery currently does not support --recursive option known from yum repoquery.

This option is hugely useful for listing whole dependency trees when attempting to trim dependencies etc.
Comment 1 Honza Silhan 2016-01-11 08:08:15 EST
isn't `--tree` option what you need or do you need unformated list of unique packages?
Comment 2 Petr Spacek 2016-01-19 11:15:08 EST
even unformated list of packages would be sufficient, I can pipe it into sort -u myself :-)
Comment 3 Fedora Admin XMLRPC Client 2016-07-08 05:25:42 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 4 Fedora End Of Life 2016-11-24 09:45:53 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 '23'.

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 23 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 5 Michael Mráka 2016-11-28 08:44:53 EST
 dnf repoquery --whatrequires --alldeps <package>
what you are lookign for?
Comment 6 Petr Spacek 2016-11-28 10:46:53 EST
Hard to say, I do not see that option documented on
https://rpm-software-management.github.io/dnf-plugins-core/repoquery.html :-)
Comment 7 Jaroslav Mracek 2016-12-12 14:40:51 EST
Here is the link to new documentation pages:

The page that you mentioned above I haven't seen it before. Additionally I have to inform you that repoquery command is part of dnf from dnf version 2.0 (rawhide). 

Please can you try the rawhide version or version from our testing repository ('dnf copr enable rpmsoftwaremanagement/dnf-nightly') if requested output is sufficient for your user case.
Comment 8 Petr Spacek 2016-12-15 11:51:01 EST
I just tested it with dnf-2.0.0_0.rc2.1-18g5f8fbdd.fc24.noarch from nightly repo.

What I wanted to achieve is basically recursive version of:
dnf repoquery --resolve --requires freeipa-server*

So, it is not exactly what I wanted but luckily enough this should be easy enough to wrap in a shell script which would call repoquery repeatedly until it walks over the tree.

Thank you!
Comment 9 Fedora End Of Life 2016-12-20 12:40:35 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 10 Jaroslav Mracek 2017-04-05 04:19:54 EDT
The recursive option was will be implemented in dnf-2.3.0.
Comment 11 Trevor Cordes 2017-04-24 03:18:27 EDT
Petr Spacek, I too am trying to recover some of the functionality that yum gave in recursive requires/provides output, mostly in tree format.

I've gotten F24's dnf 1.1.10-4 to give me some usable output with:

dnf repoquery --whatrequires bash --installed --arch=$MACHTYPE,noarch --tree --resolve

Took me a long time to get the syntax right.  Replace "bash" with the package of choice.  The output is ugly, but perfect for a script.  Note, the above command shows "down the tree", i.e. what is shown requires bash.  To go "up the tree" use --requires (I think); it's all quite confusing!

That last thing I need to solve is how to get my above command to show me just the base package name with no version at all (i.e. show me dracut not dracut-044-21...), as stripping off the version isn't as easy as looking for "dash number".  In yum I used to combine the --tree-whatrequires option with -qf="%{name}" but the new --qf and --tree seem mutually exclusive (tree just ignores qf now).  Time to look at the source...
Comment 12 Trevor Cordes 2017-04-24 04:13:24 EDT
Follow-up: checked the source, turns out --tree hardcodes the format and ignores --qf as I suspected.  So I added --qf support to --tree and put up a patch in a new bz: bug# 1444751

With this it should now be possible in the current F24/25 version of dnf to get similar results as yum used to give with recursive/resolve, at least in my use case.
Comment 13 Trevor Cordes 2017-04-24 04:42:16 EDT
Sorry to bug the bugzilla again, but you also need "--alldeps" in there for some reason or some weird subset of the deps are shown.  This is very weird as the man page says "alldeps" is the default (may be a new bug?).  So you want something like:

dnf repoquery --whatrequires gtk2 --alldeps --installed -arch=$MACHTYPE,noarch --tree --queryformat '%{name}' --resolve

Ah!  Now my nice script that links into graphviz to give me a pretty graph picture of a package's deps works again (broken since dnf took over).
Comment 14 Jaroslav Mracek 2017-04-24 07:15:54 EDT
Trevor, please if any new issue appears, please create the new bugzilla because this bug is closed and can be easily overlooked. Thanks a lot.
Comment 15 Jaroslav Mracek 2017-04-24 07:19:46 EDT
The --alldeps as default is valid for dnf-2.x but not for dnf-1.1.x . Latest DNF can be installed for our test repository (dnf copr enable rpmsoftwaremanagement/dnf-nightly)

Note You need to log in before you can comment on or make changes to this bug.