How can I find out which packages have a build requirement on some package foo? I'm aware of the following command

dnf repoquery --alldeps --recursive --whatrequires foo

in order to query all packages which have a requirement on package foo. However, packages with a build requirement only are not listed there. How can I list such packages, too?


While build requirements are indeed not stored in the final RPM (as jsbillings pointed out) dnf was improved over the last years so you can actually query build requirements now.

dnf repoquery '--disablerepo=*' '--enablerepo=*-source' --arch=src \
      --whatrequires <provide>

Source: Examples in the DNF Command Reference (at the very end of that section)

  • I've tested it with python3-asynctest and it seems to work. Perhaps it's worth noting that apparently one still has to specify a binary package name (e.g. python3-asynctest and not python-asynctest) but the command lists source packages (e.g. python-aioresponses-0:0.6.3-1.fc31.src). – maxschlepzig Sep 6 '20 at 18:36

Build requirements aren't stored in the RPM metadata of a non-source RPM, so they would not be searchable by dnf. You'd have to look at the .spec file used to build the RPM to find the BuildRequires: tags.

  • Oh that is a good point, though, sad to hear ;-) in that case I have to manually query spec files. – Max Maier Aug 21 '19 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.