Field Note

Showing a dependency graph for installed Brew packages

homebrew dependency-graph
Posted on Friday, May the 10th 2024
1 min read

Brew will helpfully refuse to uninstall packages that are required by other installed packages, so you could also go the trial and error path. But, if we want to find out which packages are not required by others—and may, therefore, be uninstalled—, we may run

brew deps --installed --dot --graph | grep -- '-> "<the-package-name>"'

E.g.

$ brew deps --installed --dot --graph | grep -- '-> "libidn2"'
"gnutls" -> "libidn2"
"wget" -> "libidn2"
# ...

lists libidn2 as a dependency for packages gnutls and wget meaning that it cannot not be uninstalled without likely breaking gnutls and wget (and brew uninstall has to be run with the --force flag if either of these packages actually has to be removed).

friedrichkurz.me

© 2025 Friedrich Kurz

Privacy Policy