2 homebrew guide
Eduard Ihnat edited this page 2026-05-21 20:43:18 +02:00

Homebrew Quick Reference

See What You Have Installed

# List all installed formulae (CLI tools) and casks (GUI apps)
brew list

# Separate view
brew list --formula    # CLI tools only
brew list --cask       # GUI apps only

# See outdated packages
brew outdated

# Top-level installs not required by anything else
brew leaves

Update Everything

# Step 1: update Homebrew itself and fetch new package info
brew update

# Step 2: upgrade all installed packages
brew upgrade

# Or upgrade a specific one
brew upgrade firefox

Run brew update && brew upgrade occasionally — monthly is fine for a non-server Mac.

Uninstall Something

brew uninstall <name>
brew uninstall --cask <name>   # for GUI apps

Search for Packages

brew search <name>

Get Info About a Package

brew info <name>
# Shows version, dependencies, install path, homepage

Pin / Unpin a Package

Prevent a package from being upgraded:

brew pin <name>
brew unpin <name>

Useful for tools where you need to stay on a specific version.

Manage Background Services

For packages that run as background daemons (databases, Redis, etc.):

brew services list                 # show all managed services and their state
brew services start <name>         # start and enable at login
brew services stop <name>          # stop and disable at login
brew services restart <name>       # restart

Cleanup (Free Up Disk Space)

Brew keeps old versions around after upgrades. Clean them up with:

brew cleanup

# Preview what would be deleted first
brew cleanup --dry-run

Health Check

brew doctor
# Tells you if anything is misconfigured or broken

Tips

  • Formulae vs Casks — formulae are CLI tools (mlr, wget, htop), casks are GUI apps (jordanbaird-ice, firefox, iterm2). Most commands work for both, just add --cask when needed.
  • Where things are installed — formulae go to /opt/homebrew/bin/ (Apple Silicon) or /usr/local/bin/ (Intel). This is automatically on your $PATH.
  • Tap — if a package isn't found, it might be in a third-party tap. You'll usually see brew tap <repo> instructions on the project's page.
  • Auto-update — Brew auto-updates itself before installs. To disable: add export HOMEBREW_NO_AUTO_UPDATE=1 to your .zshrc.