DNF command to show what CLI/binaries/tools a package provides?

It has been shown to me that I can use dnf provides to check what CLI tool is provided by a specific package.

E.g. given I have cool-command I want to execute, but have not installed I can run dnf provides cool-command and see what package (e.g. libcommanders) provides this.

However, is there also a (DNF) command I can use to do the “reverse”, i.e. I know libcommanders and want to see what CLI tools I can call when I install it?

Note: Installing and trying does not count. :stuck_out_tongue_winking_eye: I want to know so before.

dnf repoquery -l <package>

2 Likes

Thanks, but this seems to list all the content does not it? E.g. for gnomelib it lists all locale stuff etc.

But well… in most cases when I think about it simply grepping the result should be enough:

dnf repoquery -l libgnome|grep bin/
2 Likes

+1

The metadata that rpm archives include does not distinguish between files in /bin, apart from documentation (rpm -qd ... to see docs). So, the best one can do now is to use provides or list all files and grep through them.

Here’s some information on rpm packages:

1 Like

Wait, provides does the reverse, i.e. list what packages provide a command. You meant repoquery, did not you?

1 Like

Yes, I think it’ll have to be under the repoquery command. In testing, it only seems to work there.

The man page mentions --provides under the “Query Options”, but at the moment I cannot make out if that’s under the “Repoquery command” section or not.

@FranciscoD, my understanding of the man page is that subsection “Query Options” are applicable only to repoquery command, because only repoquery command has optional <query-options> in it’s definition:

dnf [options] repoquery [<select-options>] [<query-options>] [<pkg-spec>]

And as you’ve said, practice does confirm this point on view :wink:

2 Likes