LinuxCommandLibrary

brew

Package manager for macOS and Linux

TLDR

Install package

$ brew install [wget]
copy
Search for packages
$ brew search [node]
copy
Update Homebrew
$ brew update
copy
Upgrade packages
$ brew upgrade
copy
List installed packages
$ brew list
copy
Uninstall package
$ brew uninstall [package]
copy
Show package info
$ brew info [package]
copy

SYNOPSIS

brew command [options] [formula]

DESCRIPTION

brew (Homebrew) is a package manager for macOS and Linux. It installs software from source or pre-compiled binaries, managing dependencies and versions. Homebrew has become the de facto standard package manager for macOS.
The tool simplifies software installation and maintenance on Unix-like systems.

PARAMETERS

install formula

Install package
uninstall formula
Remove package
update
Update Homebrew itself
upgrade [formula]
Upgrade packages
search query
Search for packages
list
List installed packages
info formula
Show package information
doctor
Check system for problems
cleanup
Remove old versions

CONCEPTS

Formula

Package definition (e.g., wget, node)
Cask
macOS GUI application (e.g., firefox, slack)
Tap
Third-party repository
Cellar
Where packages are installed (/usr/local/Cellar)

COMMON OPERATIONS

$ # Install package
brew install node

# Install GUI app (macOS)
brew install --cask firefox

# Update package database
brew update

# Upgrade all packages
brew upgrade

# Show outdated
brew outdated

# Cleanup old versions
brew cleanup

# Add third-party tap
brew tap homebrew/cask-fonts
copy

SERVICES

$ # Start service
brew services start postgresql

# List services
brew services list

# Stop service
brew services stop redis
copy

CAVEATS

macOS system updates can break Homebrew. Requires Xcode Command Line Tools on macOS. Can conflict with system Python. Upgrades all dependencies (not minimal updates). Large download sizes for some packages.

HISTORY

Homebrew was created by Max Howell in 2009 to provide a simple, Git-based package manager for macOS, becoming the most popular macOS package manager.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community