Is there anyway to have the command brew
show all the installed or optional dependencies for any given package? It would also be helpful to see which of the install packages are themselves the dependencies of others packages.
Packages installed using Homebrew are all installed in a specific folder. Typically it's /usr/local/Cellar . If you don't find this folder, run brew --prefix to find the correct folder prefix. On my system, this command returned /usr/local , the place where the Cellar folder can be found.
By default, Homebrew will install all packages in the directory /usr/local/Cellar/ , and also creates symbolic links at /usr/local/opt/ and /usr/local/bin/ (for executable files).
brew list: This is the basic command to list all installed packages by homebrew. It lists down all packages like below: brew list. brew list —cask: brew list —cask will list down all the items installed by using homebrew cask: brew list --cask brew outdated: brew outdated is used to list down all outdated packages. For example:
brew outdated is used to list down all outdated packages. For example: We can also use brew outdated —cask to use the same command with homebrew cask. This command shows all the packages and the dependency packages installed.
I found the brew deps --tree switch is also very helpful to visualize dependencies just in the command line. From the official doc: brew deps --tree [--1] [filters] [--annotate] (formulae|--installed): Show dependencies as a tree.
brew list —cask will list down all the items installed by using homebrew cask: brew outdated is used to list down all outdated packages. For example: We can also use brew outdated —cask to use the same command with homebrew cask.
brew deps --tree --installed
Thanks to rob-kovacs for suggesting the --tree
addition
See this super helpful article for details: https://blog.jpalardy.com/posts/untangling-your-homebrew-dependencies/ Especially if you're interested in creating a graph of the dependency tree.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With