6

example: I can see a package "XYZ" has been installed. I want to find out which package installed XYZ because it's one of its dependencies.

Thanks

mrjayviper
  • 2,051

1 Answers1

9

A single package can be required by multiple different packages so it's not always obvious, specially if you installed a bulk of them.

Ways to check it:

  1. sudo dnf repoquery --whatrequires package or rpm -q --whatrequires package

  2. Simply running sudo dnf history package| egrep -w 'install|upgrade' will show you all the operations with the package and by inspecting them you can infer which other packages required the package.

  3. Also, you can simply try uninstalling the xyz and see what it leads to: sudo dnf --assumeno remove package or rpm -e --test package

  • I'm not super familiar with dnf history details, but dnf repoquery --whatrequires package will show all the packages in the repo that depend on package (see --whatrecommends, --whatsuggests, etc., as well). rpm -q --whatrequires package will also show the installed packages that depend on package. – rickhg12hs Aug 10 '21 at 02:35
  • 1
    Thank you @rickhg12hs – Artem S. Tashkinov Aug 10 '21 at 11:39