Brew Cheatsheet

Basic Commands

# Example usage:
$ brew search [TEXT|/REGEX/]
$ brew info [FORMULA...]
$ brew install FORMULA...
$ brew update
$ brew upgrade [FORMULA...]
$ brew uninstall FORMULA...
$ brew list [FORMULA...]

# Troubleshooting:
$ brew config
$ brew doctor
$ brew install --verbose --debug FORMULA

# Contributing:
$ brew create [URL [--no-fetch]]
$ brew edit [FORMULA...]

# Further help:
$ brew commands
$ brew help [COMMAND]
$ man brew

Homebrew Updating

  • brew update updates Homebrew itself

  • brew upgrade updates the installed packages.

Typical workflow

$ brew doctor  [--verbose]  # ensure brew is clean and consistent
$ brew update  [--verbose]  # update the formulae and Homebrew itself
$ brew outdated             # what is outdated
$ brew upgrade [--verbose]  # upgrade everything
$ brew upgrade <formula>    # upgrade a specific formula
$ brew doctor  [--verbose]  # ensure brew is still clean and consistent

Homebrew Casks

The --cask extension is built on top of Homebrew to simplify the installation and updating of applications such as Google Chrome, Firefox, Alfred, Docker etc. (avoids manually downloading and installing the .dmg file)

$ brew search --cask firefox                 # search, incomplete names permitted
$ brew install --cask [--verbose] firefox    # install
$ brew uninstall --cask [--verbose] firefox  # uninstall