Agentic Research

Homebrew

Also: brew · brew install · brew cask · homebrew 是什麼

The de-facto package manager on macOS (and Linux): one command to install, update and remove tools and applications.

When you will meet it

Mac AI-environment guides assume it is already there: line one is "brew install something". Without it you stall at step one; with it but not knowing where it puts things, you meet two follow-up traps — "command not found" because its bin folder is not on PATH, and the "externally-managed-environment" error from the Python it installs. Both traps have their own glossary entries and real incident reports.

An analogy

Like an App Store for command-line tools, operated entirely by typing: name a package and it downloads, installs and files everything away; one command removes it cleanly — no hunting the web for installers, no dragging things around by hand.

Minimal example

brew --version          # 確認 brew 本身裝好了沒
brew search ollama      # 找有什麼可以裝
brew install wget       # 裝一個小工具
brew list               # 看裝過哪些東西
brew uninstall wget     # 不要了就移除

If brew itself is missing, install it with the official one-liner from the brew.sh home page (pasted into Terminal). Its home differs per platform: /opt/homebrew on Apple Silicon Macs, /usr/local on Intel Macs, /home/linuxbrew/.linuxbrew on Linux — which is why tutorial paths sometimes do not match yours.

What people get wrong

  • Mixing sudo with brew. Homebrew is designed to run as your normal user and errors out under root. If past sudo use scrambled directory ownership, brew doctor will flag it — the cure is fixing ownership, not escalating.
  • Assuming the command works everywhere the moment brew install finishes. If brew's bin folder is not on PATH you still get "command not found"; follow the post-install instructions to set PATH, then open a fresh terminal (see the PATH entry for this trap).

Related terms

Next