[Homebrew Series 2] Installation and Terminal Setup

한국어 버전

Install Homebrew and Configure the Terminal

In this part we’ll open the terminal and walk through the entire Homebrew installation. Each step pairs the command with the output you should expect—compare as you go.

What We’ll Do

  • Open the terminal and install Homebrew
  • Add the Homebrew path to .zshrc
  • Verify that everything works

Before You Start

You’ll need:

  • A MacBook (Intel or Apple Silicon)
  • Internet access
  • Admin privileges (your Mac login password)

Time required: around 10–15 minutes

First check your Mac’s chip:

uname -m

Interpret the result:

  • arm64 = Apple Silicon (M1/M2/M3)
  • x86_64 = Intel

Homebrew uses a different install path on each architecture, so keep that result in mind for Step 5.

Step 1: Open Terminal

Using Spotlight:

  1. Press Command + Space
  2. Type “terminal”
  3. Press Enter

Using Launchpad:

  1. Click the Launchpad icon
  2. Open the “Other” folder
  3. Click Terminal

Check: a black window with white text means success.

Step 2: Install Xcode Command Line Tools

This is a one-time setup step. Homebrew sometimes needs Apple’s developer tools to build packages, so installing them now avoids confusion later.

Run the Command

xcode-select --install

You’ll see a popup that guides you through the installation.

Proceed: click “Install” → agree to the terms → wait 5–10 minutes.

Already installed: you may see one of these responses:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

or no new dialog at all.

Either way, you can move on.

Confirm the Install

xcode-select -p

Expected output:

/Library/Developer/CommandLineTools

If that path prints, you’re good.

Step 3: Install Homebrew

Official Install Script

Copy and paste this into Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Installing Homebrew zsh · ~/workspace
Ready. Press Replay to run the scripted session.

What this command does: it downloads Homebrew’s official installer script and runs it with Bash.

What to notice in the output:

  • Downloading and installing Homebrew... means the installer is running
  • Installation successful! means the install completed
  • Next steps: shows the shell command Homebrew wants you to run next

What You Might See During Installation

  1. Password prompt Type your Mac login password. ⚠️ Important: the cursor won’t move—type anyway, then press Enter.

  2. “Press RETURN/ENTER” Press Enter when asked.

  3. Download and install messages Wait 5–10 minutes. A pause during downloading is normal.

  4. Completed install Look for Installation successful! before moving on.

Step 4: Verify the Install

Check the Version

brew --version

Expected output:

Homebrew 4.4.12

(Version numbers may differ.)

Check Help Output

brew help

Getting a list of commands means you’re ready.

Quick Success Check

Good signs:

  • brew --version prints a version number
  • brew help prints a command list
  • you do not see command not found

Stop and troubleshoot if you see:

  • zsh: command not found: brew
  • Permission denied
  • Failed to connect

Step 5: Configure .zshrc

Why This Matters

.zshrc is a startup file that zsh reads whenever Terminal opens. Adding Homebrew there makes the brew command available in future Terminal sessions.

On Apple Silicon, Homebrew usually lives in /opt/homebrew. On Intel Macs, it usually lives in /usr/local. You need the path that matches your Mac.

Confirm You’re Using zsh

echo $SHELL

Expected output:

/bin/zsh

If you see a different shell, the Homebrew install still works, but this post explains the default zsh setup that macOS uses for most beginners.

Check Your Current State

which brew

Interpret the result:

  • /opt/homebrew/bin/brew or /usr/local/bin/brew = the path is already available; skip to Step 6.
  • brew not found or zsh: command not found: brew = keep going.

Inspect .zshrc

ls -la ~/.zshrc

If the file doesn’t exist: create it with touch ~/.zshrc.

If it does exist: back it up with cp ~/.zshrc ~/.zshrc.backup.

Add the Homebrew Path

Choose the command that matches the uname -m result from the beginning of the post.

Apple Silicon (arm64):

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc

Intel (x86_64):

echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zshrc

This command appends Homebrew’s environment setup to .zshrc without overwriting the rest of the file.

Step 6: Apply the Settings

Reload the Current Terminal Session

source ~/.zshrc

Meaning: immediately loads the .zshrc configuration without restarting Terminal.

Configuring .zshrc zsh · ~/workspace
Ready. Press Replay to run the scripted session.

Step 7: Final Checks

Confirm the brew Path

which brew

Apple Silicon output:

/opt/homebrew/bin/brew

Intel output:

/usr/local/bin/brew

Run brew doctor

brew doctor

Expected message A:

Your system is ready to brew.

→ Perfect!

Expected message B:

Warning: ... (some warning)

→ If it ends with “working fine,” you can ignore it for now.

If you get a real error instead, jump to the troubleshooting section below.

Restart Terminal to Double-Check

  1. Quit Terminal completely (Command + Q)
  2. Reopen Terminal
  3. Run brew --version

Seeing the version confirms the setup persists.

Quick Diagnostic Bundle

xcode-select -p
brew --version
which brew
brew doctor
uname -m

Healthy output example:

/Library/Developer/CommandLineTools
Homebrew 4.4.12
/opt/homebrew/bin/brew
Your system is ready to brew.
arm64

Troubleshooting

Mistake 1: “zsh: command not found: brew”

What happened: Terminal cannot find the brew command.

Cause:

  • Homebrew path never got added to .zshrc, or
  • The path points to the wrong prefix.

Fix for Apple Silicon:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
source ~/.zshrc
brew --version

Fix for Intel Macs:

echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zshrc
source ~/.zshrc
brew --version

Mistake 2: “Permission denied”

Symptom: Operation not permitted or other permission errors.

Cause: Trying to run Homebrew commands with sudo.

Fix: Drop sudo; Homebrew handles permissions itself.

Mistake 3: “Already up-to-date”

Symptom: You see “Already up-to-date” during an upgrade.

Fix: That isn’t an error—it just means you’re current.

Mistake 4: “Failed to connect to raw.githubusercontent.com”

Cause: Network or DNS issue.

Fix: Try again later or switch networks.

Mistake 5: Mixing Intel and Apple Silicon Instructions

Check your chip:

uname -m

Results:

  • arm64 = Apple Silicon (M1/M2/M3)
  • x86_64 = Intel

Each needs a different path in .zshrc (see above).

Success Criteria

Tick these boxes:

  • Opened Terminal (Command + Space → terminal)
  • Installed Xcode Command Line Tools (xcode-select --install)
  • Ran the Homebrew install script
  • Saw “Installation successful!”
  • Confirmed the version with brew --version
  • Created or edited .zshrc
  • Added the Homebrew path (eval "$(/opt/homebrew/bin/brew shellenv)")
  • Applied the config with source ~/.zshrc
  • Checked the path with which brew
  • Verified brew works after restarting Terminal

Next to try:

# Sample installs
brew install git
brew install node
brew install --cask visual-studio-code

Coming Up Next

Once Homebrew is installed, it’s time to install and manage real packages.

Homebrew Series 3: Installing and Managing Packages teaches how to use brew install, brew upgrade, and brew uninstall in practice.

💬 댓글

이 글에 대한 의견을 남겨주세요