Skip to main content

Homebrew

Homebrew is very handy package manager for macOS (also available for Linux). Install homebrew:

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

Install a package (also called formulae, usually command-line utilities):

brew install wget

Info about a package:

brew info gnupg

Search for a package:

brew search fftw

Install a cask (usually graphical apps, by default placed under macOS Applications folder):

brew install --cask firefox

List all installed packages:

brew list

Update a specific package:

brew upgrade wget

Update brew and cask:

brew update

Upgrade all installed packages:

brew upgrade

The above does not upgrade the casks if the casks are set to auto update. You can upgrade anyway via brew by:

brew upgrade --cask --greedy

Switch off analytics

brew analytics off

Cleanup (use the flag --dry-run to list what will be deleted before actually deleting):

brew cleanup --prune=all --dry-run
brew cleanup --prune=all

Remove dependencies no longer needed:

brew autoremove --dry-run
brew autoremove

Troubleshooting issues:

brew doctor

Check the dependency tree:

brew deps --tree --installed
brew deps --tree --installed gnupg