Skip to content

Homebrew

Homebrew is the Mac package manager. Install it:

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

Common Homebrew Commands

CommandWhat It Does
brew install <package>Install a CLI tool
brew install --cask <app>Install a GUI app
brew listShow installed packages
brew updateUpdate Homebrew itself
brew upgradeUpgrade all packages
brew uninstall <package>Remove a package
brew search <name>Search for packages
brew cleanupRemove old versions

Homebrew. Your Package Manager

Homebrew is the unofficial (but universal) package manager for macOS. If you used apt, yum, choco, or winget: same idea.

Install Homebrew

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

Core Commands

CommandWhat It Does
brew install <name>Install a command-line tool (git, node, python)
brew install --cask <name>Install a GUI app (firefox, visual-studio-code, discord)
brew updateRefresh the list of available packages
brew upgradeUpgrade all installed packages
brew upgrade <name>Upgrade a specific package
brew listShow everything you've installed
brew search <name>Search for a package
brew uninstall <name>Remove a package
brew info <name>Show details about a package
brew doctorDiagnose common issues

Keeping Everything Current

bash
# Update and upgrade everything in one shot
brew update && brew upgrade

# Clean up old versions
brew cleanup

Tip: Run brew update && brew upgrade weekly. Or add it to your shell profile to run on terminal open.

Homebrew vs Alternatives

MethodBest ForAuto-Update?
HomebrewCLI tools + GUI appsManual (brew upgrade)
Mac App StoreApple-curated apps, sandboxedAutomatic
Direct download (.dmg/.pkg)Apps not in Homebrew or App StoreVaries (app-specific)

Mac App Store (mas)

The mas CLI lets you manage App Store apps from the terminal.

Install

bash
brew install mas

Commands

CommandWhat It Does
mas listShow installed App Store apps
mas search <name>Search the App Store
mas install <id>Install by app ID
mas upgradeUpgrade all App Store apps
mas outdatedShow apps with available updates

Finding App IDs

bash
mas search "Xcode"
# Output: 497799835  Xcode (16.0)

mas install 497799835

One-Command Update Strategy

Create an alias that updates everything at once:

bash
# Add to ~/.zshrc
alias update-all='brew update && brew upgrade && brew cleanup && mas upgrade'

Then just run:

bash
update-all

App Installation Methods Compared

.dmg Files (Disk Images)

  1. Double-click the .dmg to mount it
  2. Drag the app to the Applications folder
  3. Eject the disk image (right-click → Eject)
  4. Delete the .dmg from Downloads

.pkg Files (Installers)

  1. Double-click the .pkg
  2. Follow the installer wizard
  3. These can install system-level components (drivers, services)

.app Files (Standalone)

Just drag to /Applications. That's it.

Homebrew Casks

bash
brew install --cask firefox

Installs to /Applications automatically. Uninstall with brew uninstall firefox.

What to Install Where

App TypeRecommended Method
Developer tools (git, node, python)Homebrew (brew install)
Popular GUI appsHomebrew Cask (brew install --cask)
Apple apps (Xcode, iMovie)Mac App Store
Corporate/enterprise appsYour IT department's method (Intune, Jamf)
Niche apps without Homebrew formulaDirect download from developer

Uninstalling Apps

GUI Apps

  1. Open Finder → Applications
  2. Drag the app to Trash (or right-click → Move to Trash)
  3. Empty Trash

Note: Some apps leave behind preferences in ~/Library/Preferences/ and support files in ~/Library/Application Support/. For a clean uninstall, use brew uninstall or an app like AppCleaner.

Homebrew Apps

bash
brew uninstall <name>

Checking What's Installed

bash
# Homebrew packages
brew list

# App Store apps
mas list

# Everything in /Applications
ls /Applications