Managing Packages with Homebrew on macOS
Homebrew is the most popular package manager for macOS, providing a simple and efficient way to install, update, and manage software packages. It streamlines the process of maintaining software on your Mac through command-line interface.
Key Features
Section titled “Key Features”Package Management
- Install, update, and remove software packages
- Manage dependencies automatically
- Track installed formulae and casks
- Handle system-wide and user-specific installations
Installation
Section titled “Installation”/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Common Usage Examples
Section titled “Common Usage Examples”Basic Package Operations
# Install a packagebrew install wget
# Search for packagesbrew search python
# Remove a packagebrew uninstall wget
# List installed packagesbrew listUpdate Operations
# Update Homebrew and formulaebrew update
# Show outdated packagesbrew outdated
# Upgrade all packagesbrew upgrade
# Upgrade specific packagebrew upgrade nodeMaintenance Operations
# Clean up old versionsbrew cleanup
# Check system for potential problemsbrew doctor
# Display package informationbrew info postgresqlAdditional Tips
Section titled “Additional Tips”Service Management
# Start a servicebrew services start postgresql
# List running servicesbrew services list
# Stop a servicebrew services stop postgresqlCask Operations
# Install GUI applicationsbrew install --cask firefox
# List installed casksbrew list --caskPrerequisites
- macOS 10.14 or higher
- Command Line Tools for Xcode
- Administrator privileges for installation