Fedora – dnf what build requires package foo

dnffedorayum

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?

Best Answer

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)

Related Question