Homebrew: notes and tips This note was created on 2024-04-03 This note was last edited on 2024-04-03 Homebrew (brew) is a free and open-source software package management system that simplifies the installation of software on Apple's operating system, macOS, as well as Linux. === Terminology === formula - Homebrew package definition that builds from upstream sources cask - Homebrew package definition that installs macOS native applications prefix - path in which Homebrew is installed, e.g. /usr/local keg - installation destination directory of a given formula version, e.g. /usr/local/Cellar/foo/0.1 rack - directory containing one or more versioned kegs, e.g. /usr/local/Cellar/foo keg-only - a formula is keg-only if it is not symlinked into Homebrew’s prefix opt prefix - a symlink to the active version of a keg, e.g. /usr/local/opt/foo Cellar - directory containing one or more named racks, e.g. /usr/local/Cellar Caskroom - directory containing one or more named casks, e.g. /usr/local/Caskroom external command - brew subcommand defined outside of the Homebrew/brew GitHub repository tap - directory (and usually Git repository) of formulae, casks and/or external commands bottle - pre-built keg poured into a rack of the Cellar instead of building from upstream sources === Installation === 1. Open Terminal and execute the following command: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2. Check installation: $ brew --version 3. Disable analytics: $ brew analytics off === Basic Commands === Update Homebrew: $ brew update Upgrade packages: $ brew upgrade List installed packages: $ brew list Search for a package: $ brew search Show package information: $ brew info Uninstall a package: $ brew uninstall === Package Management === Install a package: $ brew install Force install: $ brew install --force Reinstall a package: $ brew reinstall Upgrade a package: $ brew upgrade Pin a package to prevent upgrades: $ brew pin Unpin a package: $ brew unpin === Cleaning === Remove dependencies that are now no longer needed: $ brew autoremove Remove old versions: $ brew cleanup Remove unreferenced symlinks: $ brew cleanup -s Remove inactive versions only: $ brew cleanup -n === Taps and Casks === Add a tap: $ brew tap Remove a tap: $ brew untap Install a cask: $ brew install --cask Uninstall a cask: $ brew uninstall --cask === Troubleshooting === Check for issues: $ brew doctor Verify and diagnose: $ brew verify Reset Homebrew: $ brew update-reset Reinstall Homebrew: $ brew reinstall homebrew