Skip to content

macOS Homebrew Cheat Sheet

Quick-reference guide for installing, updating, and cleaning up software on macOS with Homebrew.


Install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Configure Shell Environment (~/.zprofile):

eval "$(/opt/homebrew/bin/brew shellenv)"

Update Homebrew & Formulae Metadata:

brew update

Upgrade All Installed Formulae & Casks:

brew upgrade

Upgrade Including Auto-Updating GUI Casks:

brew upgrade --greedy

Install CLI Package (Formula):

brew install [formula]

Install GUI Application (Cask):

brew install --cask [app_name]

Search Formulae and Casks:

brew search [query]

Inspect Package Dependencies & Analytics:

brew info [formula_or_cask]

List Installed Formulae:

brew list --formula

List Installed Casks:

brew list --cask

Show Dependency Tree for Installed Packages:

brew deps --tree --installed

Uninstall Package Only:

brew uninstall [formula]

Completely Purge Cask (Removes App, Caches, and .plist Preferences):

brew uninstall --cask --zap [app_name]

Remove Orphaned Dependencies:

brew autoremove

Purge Old Versions & Clear Download Cache:

brew cleanup --prune=all -s

Export Installed Packages to a Brewfile (For Reproducible Setup):

brew bundle dump --file=~/Brewfile --describe --force

Install All Packages from a Brewfile:

brew bundle --file=~/Brewfile

Audit Homebrew Installation Health:

brew doctor

Sources & Verification