Dnf rq --depends --resolve equiv in dnf5

In dnf4 running

dnf rq --depends --resolve weston-libs

would return a list of packages weston-libs depended upon.

This syntax is not supported in dnf5 though it will still list capabilities the same as dnf4

dnf rq --depends weston-libs

This can be processed to produce the list of packages with something like

dnf rq --depends weston-libs | while read dep;do dnf rq -q --whatprovides $dep;done | sort -u

but it is very slow compared to the dnf4 way.

Are there better ways to query the repo metadata in a dnf5 world?

1 Like

Added dnf5

dnf rq --providers-of=depends weston-libs

https://dnf5.readthedocs.io/en/latest/commands/repoquery.8.html#repoquery-command-ref-label
https://dnf5.readthedocs.io/en/latest/changes_from_dnf4.7.html#changes-to-individual-commands

4 Likes

man dnf5-repoquery or man dnf repoquery

lol, I’ve never looked at that until now as I’ve always preferred the online docs.

1 Like

Is there a way to combine dnf rq --providers-of=depends package_name with dnf list --installed?
In this way the list would be filtered for the packages actually installed. This would be very useful because the command that you have mentioned shows the versions of all the architectures and also shows the non-installed dependencies belonging to different repositories (for example ffmpeg-libs and libavcodec).

I’ve been using dnf rq --providers-of=depends package_name to see what would be installed before installing a packages. For already installed packages

dnf rq --providers-of=depends package_name --installed

works fine. For not-yet-installed packages it only show depends that are already installed.
See also man rpm as all the info for installed packages can be found from that.

2 Likes

Really thank you!