问题
Over time, I've installed a number of packages with Homebrew, mostly from the default repo of formulae (homebrew-core), but some from other locations via brew tap.
Now I'm putting together some install scripts to make my dev environment more reproducible, and I'm trying to figure out which packages can be installed by a simple brew install and which require a brew tap beforehand.
The ability to query brew has proved useful for figuring out which options I used for each package, but not for this tap-related question. Is there a way to do this without manually going through each package and seeing where it's available?
回答1:
I found a couple ways that work.
brew list --full-name
Slower, but a little more informative:
brew info $(brew list) | grep '^From:' | sort
回答2:
This expression would return a list of installed 3rd party packages only:
brew list --full-name -1 | grep /
…for the respective list of taps in use, try:
brew list --full-name -1 | grep / | cut -d"/" -f1 -f2 | sort | uniq
来源:https://stackoverflow.com/questions/44357161/homebrew-list-the-packages-installed-from-taps