Package Management

brew

Homebrew package manager for macOS and Linux.

Synopsis

syntax
brew [COMMAND] [OPTION]... [FORMULA]...

Examples

Install Node.js
brew install node
Update Homebrew and upgrade all packages
brew update && brew upgrade
Search for Redis
brew search redis
Install Firefox desktop app
brew install --cask firefox
List installed packages
brew list

Common options

FlagDescription
installInstall formula or cask
uninstallRemove formula
updateUpdate Homebrew itself
upgradeUpgrade installed formulae
searchSearch for formulae
listList installed formulae

About brew

The `brew` command homebrew package manager for macOS and Linux. Package management commands install, update, and remove software on Linux distributions.

Each distribution family has its own package manager — apt for Debian/Ubuntu, yum/dnf for RHEL/Fedora, pacman for Arch, and so on. Understanding your distro's package manager is one of the first steps in Linux administration.

The command accepts 6 commonly used flags shown above, though the full set of options is available in the man page (`man brew`). The 5 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Package Management Commands

Other commands in the Package Management category

Related tools