Notes

Homebrew Commands

Edit on GitHub

Cheatsheets

Homebrew is a package manager for MacOS, very much like apt is a package manager for Ubuntu/Debian Linux.

It lets you install, update, upgrade and uninstall programs via the command line. It also let’s you install some Linux programs for your Mac, like wget for example.

Homebrew also let’s you add programs to launchd so that they automatically start and restart with login. For example brew services start mongodb

install Homebrew with this command:

1/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Commands

CommandDescription
brew install fooInstall package
brew upgrade fooUpgrade package
brew unlink fooUnlink (removes symlinks, e.g. before upgrades)
brew link fooLink
brew switch foo 2.5.0Change versions
brew list --versions fooSee what versions you have
brew info fooGet info about package, List versions, caveats, etc
brew cleanup fooRemove old versions
brew edit fooEdit this formula
brew home fooOpen homepage
brew updateUpdate brew and cask
brew listList installed
brew outdatedWhat’s due for upgrades?
brew --cellarShows the path for Cellar directory

Upgrade a package:

brew unlink foo and then brew upgrade foo

Related