Homebrew

This article introduces usage of tool Homebrew on MacOS.

Commands

Syntax:

brew --version
brew <command> [--verbose|-v] [options] [formula] ...

Show Homebrew and system configuration info useful for debugging:

brew config

Fetch the newest version of Homebrew and all formulae from GitHub using git and perform any necessary migrations:

brew update

List all installed formulae:

brew list
brew list --version

Perform a substring search of cask tokens and formula names for text. If text is flanked by slashes, it is interpreted as a regular expression. The search for text is extended online to homebrew/core and homebrew/cask. If no search term is provided, all locally available formulae are listed.

brew search [text|/text/]

Install formula:

brew install <formula>

Display brief statistics for your Homebrew installation. If a formula or cask is provided, show summary of information about it:

brew info [formula]
brew abv [formula]

Upgrade formula:

brew upgrade <formula>

Uninstall formula:

brew uninstall <formula>

Check your system for potential problems. Will exit with a non-zero status if any potential problems are found:

brew doctor [--list-checks] [--audit-debug] [diagnostic_check ...]

Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed:

brew autoremove [--dry-run]

Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae.

brew cleanup [options] [formula|cask ...]

References