Which package provides xxd? Could not figure it out

Hello all.

Happy new year!

I was working and reading the documentation of a FastSitePHP and there xxd is used there to generate hex strings. There is said that xxd is not installed by default on RH distros, but is installed on my Fedora 31. I don’t know why and how.

I search for a package that could contain xxd with DNF and RPM, looked for it on the list for Fedora 29, 30 and 31, and found nothing. There is no man page for it just --help.

Now I know that it is part of vim-common because I tried to run it from a new install and then DNF showed that info.

How can I look at packages contents with DNF (or RPM) looking for a program like in this situation?

You can use dnf whatprovides A-BINARY to find out what package contains it:

$ dnf whatprovides xxd     
vim-common-2:8.1.2102-1.fc31.x86_64 : The common files needed by any version of the VIM editor
Repo        : fedora
Matched from:
Filename    : /usr/bin/xxd

vim-common-2:8.1.2352-1.fc31.x86_64 : The common files needed by any version of the VIM editor
Repo        : updates
Matched from:
Filename    : /usr/bin/xxd

vim-common-2:8.2.019-1.fc31.x86_64 : The common files needed by any version of the VIM editor
Repo        : @System
Matched from:
Filename    : /usr/bin/xxd
1 Like

Thank you very much. How dumb of me.
I solved that by typing xxd into another Fedora system’s terminal, and discovered that was vim-common because dnf gave me a message with the info, but that is the correct way.

Why isn’t it documented that way? I found it as

repoquery --whatprovides

Did I look at the wrong documentation or is it not updated?

The dnf whatprovides and prov sub-commands are undocumented aliases for the provides sub-command.

dnf source code at github.com

The provides sub-command is documented here:


The dnf repoquery --whatprovides ... command lets you be more specific.

Example 1: list packages that provide the ‘webserver’ capability, showing only the latest version of each:

$ sudo dnf repoquery --whatprovides webserver --latest-limit=1

Example 2: same but limit to i686 packages:

$ sudo dnf repoquery --whatprovides webserver --arch=i686 --latest-limit=1 

Example 3: list the webservers that I have installed

$ sudo dnf repoquery --whatprovides webserver --installed

Example 4: pattern matching and searching on files

I didn’t see this documented, but dnf repoquery --whatprovides also allows searching on the absolute path of package files. And the fact that you can use shell-style pattern matching (works both on provided capabilities and file paths) comes in handy in this case:

$ sudo dnf repoquery --whatprovides '*/xxd' --latest-limit=1


1 Like