Homebrew Package Manager Cheatsheet
Homebrew is the most popular package manager for macOS (also available on Linux). This cheatsheet covers daily brew operations including Formula and Cask installation, uninstallation, updates, dependency management, and Tap repository configuration.
Updated: 2026-07-17·30 commands
Overview
Homebrew is a free and open-source package management system for macOS (and Linux). It simplifies the installation of software on Apple's operating system. This cheatsheet covers package management, casks, taps, and system maintenance.
Quick Start
``bash
brew install wget # Install a package
brew search python # Search for a package
brew update && brew upgrade # Update everything
``
Refer to the command table below for detailed usage.
Basic Ops(9)
| Command | Level | ||
|---|---|---|---|
brew install <formula>Install a Formula package | Basic | brew install wget | |
brew uninstall <formula>Uninstall a Formula package | Basic | brew uninstall wget | |
brew updateUpdate Homebrew itself and Formula lists | Basic | brew update | |
brew upgradeUpgrade all outdated packages | Basic | brew upgrade | |
brew outdatedList all outdated packages | Basic | brew outdated | |
brew listList all installed packages | Basic | brew list | |
brew search <text>Search Formulae or Casks | Basic | brew search python | |
brew --versionShow Homebrew version | Basic | brew --version | |
brew configDisplay Homebrew configuration | Basic | brew config |
Formula(9)
| Command | Level | ||
|---|---|---|---|
brew info <formula>Show package details | Basic | brew info nginx | |
brew deps <formula>Show package dependencies | Intermediate | brew deps openssl | |
brew deps --tree <formula>Show dependencies as a tree | Intermediate | brew deps --tree openssl | |
brew uses <formula>Show which packages depend on the given formula | Intermediate | brew uses openssl | |
brew pin <formula>Pin package version to prevent upgrades | Intermediate | brew pin python | |
brew unpin <formula>Unpin package version | Intermediate | brew unpin python | |
brew leavesList top-level packages not depended on by others | Intermediate | brew leaves | |
brew link --overwrite <formula>Force link (overwrite conflicting files) | Expert | brew link --overwrite python | |
brew unlink <formula>Unlink a package | Intermediate | brew unlink python |
Maintenance(7)
| Command | Level | ||
|---|---|---|---|
brew doctorCheck Homebrew installation health | Basic | brew doctor | |
brew cleanupClean up old versions of all packages | Basic | brew cleanup | |
brew autoremoveRemove orphaned packages with no dependents | Intermediate | brew autoremove | |
brew bundle dumpGenerate a Brewfile for the current environment | Intermediate | brew bundle dump | |
brew bundle installInstall all dependencies from Brewfile | Intermediate | brew bundle install | |
brew services start <formula>Start a background service (e.g., nginx, mysql) | Intermediate | brew services start nginx | |
brew services listList all registered services and their status | Intermediate | brew services list |
Taps(3)
| Command | Level | ||
|---|---|---|---|
brew tap <user/repo>Add a third-party repository | Basic | brew tap homebrew/cask-fonts | |
brew untap <user/repo>Remove an added repository | Basic | brew untap homebrew/cask-fonts | |
brew tapList all added tap repositories | Basic | brew tap |
Casks(2)
| Command | Level | ||
|---|---|---|---|
brew install --cask <cask>Install a GUI application (Cask) | Basic | brew install --cask visual-studio-code | |
brew upgrade --caskUpgrade all outdated Cask applications | Intermediate | brew upgrade --cask |
FAQ
This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-17.