Homebrew Package Manager
Homebrew is the de facto package manager for macOS. It simplifies the installation and management of development tools and libraries.
1.1 Installation
Run the official installation script from the terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The script will prompt for your password and explain what changes it will make before proceeding.
1.2 Path Configuration
Add Homebrew to your PATH. For Apple Silicon Macs (M1/M2/M3):
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
For Intel Macs:
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"
1.3 Verification
Confirm Homebrew is installed correctly:
brew --version
Expected output: Homebrew 4.x.x