Executing brew list
command shows a simple, alphabetically sorted list of all the installed packagesformulae and Casks (GUI apps) into two separate sections.
However, variousother required packagesformulae (dependencies) get automatically installed when installing a package using Homebrewformulae. It is possible to view the list of all the installed packages as a nicely formatted dependency tree. To view it, execute the following command:
brew deps --tree --installed
An example output is as shown below:
gdbm
openssl
python
├── gdbm
├── openssl
├── readline
├── sqlite
│ └── readline
└── xz
readline
sqlite
└── readline
xz
The independently listed packagesformulae (e.g. gdbmbash
and, opensslbrotli
in the example output above, ca-certificates
etc.) have no dependencies. The packagesformulae depicted as part of a tree structure have their dependency listed at an immediate lower level in the tree (e.g. package sqlitecocoapods
requires that the package readlineruby
which in tern requires libyaml
to be installed). The packagesformulae listed at the leaf nodes in the tree structures have no further dependencies.
Dependencies visualised in a tree structure like this can help in easily getting rid of the unnecessary packages.