Is there a DNF command that can list not-installed dependencies of a package?

179 Views Asked by At

Reading the documentation for DNF, it is unclear to me how one even lists the required dependencies of a package (NOTE: NOT my question, my question is the title).

So what I'm wondering is, how would one go about listing the packages that needs installing to install package foo?

Meaning, I want to be able to query the package manager and be provided the same information that is displayed when user does dnf install foo, where it lists the packages it will install alongside foo - but I want to be able to do it without actually running the install command (because the context constrains me from doing so, I just need this metadata).

Would greatly appreciate any input to this.

1

There are 1 best solutions below

0
Arnaud Valmary On

You could use "rpm" command like this "rpm -V package_name"

Example:

> LANG=C rpm -V qelectrotech-0.90-2.fc38.x86_64
Unsatisfied dependencies for qelectrotech-0:0.90-2.fc38.x86_64:
    qelectrotech-symbols = 0:0.90-2.fc38 is needed by (installed) qelectrotech-0:0.90-2.fc38.x86_64

Or for all installed packages:

> LANG=C rpm -Va | grep 'is needed by'
    qelectrotech-symbols = 0:0.90-2.fc38 is needed by (installed) qelectrotech-0:0.90-2.fc38.x86_64

or better with -V sub-options:

LANG=C rpm -Va --nofiles --noscripts --nosignature --nolinkto --nofiledigest --nosize --nouser --nogroup --nomtime --nomode --nordev  --nocaps