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
| Flag | Description |
|---|---|
| install | Install formula or cask |
| uninstall | Remove formula |
| update | Update Homebrew itself |
| upgrade | Upgrade installed formulae |
| search | Search for formulae |
| list | List 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