Skip to content

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

Package Management

  • Install, update, and remove software packages
  • Manage dependencies automatically
  • Track installed formulae and casks
  • Handle system-wide and user-specific installations

Installation

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Common Usage Examples

Basic Package Operations

# Install a package
brew install wget

# Search for packages
brew search python

# Remove a package
brew uninstall wget

# List installed packages
brew list

Update Operations

# Update Homebrew and formulae
brew update

# Show outdated packages
brew outdated

# Upgrade all packages
brew upgrade

# Upgrade specific package
brew upgrade node

Maintenance Operations

# Clean up old versions
brew cleanup

# Check system for potential problems
brew doctor

# Display package information
brew info postgresql

Additional Tips

Service Management

# Start a service
brew services start postgresql

# List running services
brew services list

# Stop a service
brew services stop postgresql

Cask Operations

# Install GUI applications
brew install --cask firefox

# List installed casks
brew list --cask

Prerequisites

  • macOS 10.14 or higher
  • Command Line Tools for Xcode
  • Administrator privileges for installation