C.W.K.
Stream
Lesson 02 of 05 · published

Install Homebrew the Right Way

~12 min · homebrew, installation, apple-silicon, path

Level 0Newbie
0 XP0/55 lessons0/16 achievements
0/80 XP to next level80 XP to go0% complete

The official install is one curl command pasted into Terminal. It downloads the install script, prompts you for your password (Homebrew uses sudo only during install — never after), checks for the Xcode Command Line Tools, and creates the prefix at /opt/homebrew.

The single step everyone forgets on Apple Silicon is the PATH setup afterwards. The installer prints the exact eval line at the end — copy it into ~/.zprofile so future shells find brew. If you skip this, you'll see command not found: brew in every new terminal and waste an hour blaming the install.

After install, run two checks: brew --version to confirm Homebrew is reachable, and brew doctor to confirm your environment is clean. brew doctor will warn about leftover Intel Homebrew files, broken symlinks, or PATH conflicts — fix any warnings now, before your install graph grows.

One choice point: do you want the rolling tip (default) or a tagged release? 99% of users want the rolling install — Homebrew updates fast, and tagged releases miss security patches. Stay on the default unless you have a very specific compliance reason.

Code

Install Homebrew + verify·bash
# 1. Install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 2. Add to PATH (Apple Silicon — copy from installer's last printout if different)
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# 3. Verify
brew --version       # e.g. Homebrew 5.1.0
which brew           # /opt/homebrew/bin/brew
brew doctor          # "Your system is ready to brew."
Apple Silicon vs Intel — know your prefix·bash
# Apple Silicon (M1/M2/M3/M4): brew lives here
ls /opt/homebrew/bin/brew

# Intel Macs: brew lives here
ls /usr/local/bin/brew

# If you're on Apple Silicon and 'which brew' returns /usr/local/bin/brew,
# you have Intel Homebrew left over from a Time Machine restore — uninstall it.
# See https://docs.brew.sh/Installation for the cleanup script.

External links

Exercise

Install Homebrew if you haven't already, then run 'brew doctor' and 'brew --version'. If 'brew doctor' reports anything, write down each warning verbatim — those are the gotchas you'll dodge later. Then install one tool you've actually wanted: 'brew install ripgrep' is a great first pick because rg is faster than grep and you'll use it forever.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.