Document
Tired of Googling brew commands? Whether you're installing, updating, or troubleshooting, this cheat sheet has got you covered.

Available in both PDF and web versions, the Homebrew Cheat Sheet ensures you always have the right command at your fingertips. Get it now to streamline your workflow—it's free and incredibly handy.

Download Cheatsheet

Thank you!
We have sent an invitation link to your inbox.
Oops! Something went wrong while submitting the form.

Here's your Cheat Sheet:

Download PDF
BREW INSTALLATION
Easily install `brew` on your entire fleet with the Workbrew package installer. To manually install `brew` on your machine, visit https://brew.sh, copy-paste the install command in a terminal and run it.
BREW COMMANDS
Understand `brew` command structure
brew  [options] [package_name]
`brew` uses the command structure as follows:
INSTALL PACKAGES
Install packages and their dependencies
brew install
install a given package by name
UPDATE PACKAGES
Update Homebrew and upgrade packages
brew update
update all package definitions and Homebrew itself(run automatically with commands such as `brew install `)
brew outdated
list installed packages that are outdated
brew upgrade
upgrade all outdated packages to their latest versions (also uninstall old versions)
brew upgrade
upgrade a given package and its dependencies by name (also uninstall old versions of that package)
MANAGE PACKAGE VERSIONS
Switch between different package versions (for MySQL, Java, Postgres, etc.)
brew install postgresql@12
brew install postgresql@14
install different package versions
CLEAN UP & UNINSTALL PACKAGES
Remove unnecessary packages and files
brew cleanup
remove stale files and old versions of installed packages (run periodically by commands like:`brew install `)
brew cleanup --prune=all
remove all cache files, stale lock files, outdated downloads and old versions of a given package
brew cleanup --dry-run
show what would be removed (does not run the cleanup)
brew uninstall
uninstall a package and its dependencies
brew uninstall --force
delete all versions of a package and ignore some errors
brew uninstall --ignore-dependencies
uninstall a package even if other packages depend on it
brew uninstall --dry-run
show what would be removed (does not run the uninstall)
TROUBLESHOOT
Spot issues and solve them
brew update or brew doctor
address and read about potential problems
brew docs
open online documentation in a browser (docs.brew.sh)
brew config
show Homebrew and system configuration information
brew install --verbose
show full build output when installing a package
CONFIGURATION OPTIONS
Customize the installation and behavior of packages
export HOMEBREW_FORBIDDEN_CASKS=”cask1 cask2”
block installation of specific casks
export HOMEBREW_FORBIDDEN_FORMULAE=”formula1 formula2”
block installation of specific formulae
export HOMEBREW_FORBIDDEN_TAPS=”username/repo”
block installation from or adding specific taps
export HOMEBREW_ALLOWED_TAPS=”homebrew/core”
only allow install of packages from homebrew/core
INVESTIGATE
Search and examine packages
brew list
list all installed packages
brew search text|/regex/
return all packages containing the text in their names or matching the regex
brew info
show summary of information about a package
brew list
list files of a package
TAPS
Access additional packages with HomebrewTaps are third-party repositories of packages. Beware of security risks and consider using Workbrew to manage authorized third party taps for your fleet. docs.brew.sh/How-to-Create-and-Maintain-a-Tap
brew tap
add a tap
brew tap
list all taps
brew untap
remove a tap
TERMINOLOGY
Understand key terms
bottle
pre-built keg poured into a rack of the Cellar instead of building from upstream sources
cask
package definition that distributes vendor provided binary apps, most commonly closed source applications for the desktop
Caskroom
directory containing one or more named casks, e.g./opt/homebrew/Caskroom
Cellar
directory containing one or more named kegs, e.g./opt/homebrew/Cellar
formula
package definition that builds from upstream sources, e.g. from a GitHub repository
keg
installation destination directory of a given formula version, e.g. /opt/homebrew/Cellar/wget/1.24.5
keg-only
formula that is not symlinked into Homebrew’s prefix by default
tap
directory (and usually Git repository) of formulae, casks and/or external commands