What is brew?
Brew, short for Homebrew, is a free, open‑source package manager for macOS (and Linux). It lets you install, update, and manage software from the command line with simple commands, handling all the behind‑the‑scenes steps automatically.
Let's break it down
- Package manager: A tool that downloads software, resolves its dependencies, and places files where they belong.
- Formula: The script that tells brew how to build and install a specific piece of software.
- Tap: An additional repository of formulae that you can add to get more software.
- brew command: You type
brew install <name>
to get a program,brew update
to refresh the list, andbrew upgrade
to get newer versions.
Why does it matter?
Without brew, installing many developer tools on macOS requires manually downloading .dmg files, dragging apps, or compiling from source-steps that are error‑prone and time‑consuming. Brew automates this, ensuring you get the right version and all required libraries, which speeds up setup and keeps your environment consistent.
Where is it used?
- On personal Macs for setting up development environments (Python, Node, Docker, etc.).
- In CI/CD pipelines on macOS runners to quickly provision tools.
- By system administrators who need to manage software across many Macs.
- On Linux via “Linuxbrew,” the same Homebrew code adapted for Linux distributions.
Good things about it
- Simple syntax: One‑line commands do most of the work.
- Large library: Thousands of formulae cover common dev tools, databases, utilities, and more.
- Dependency handling: Automatically installs required libraries.
- Community‑driven: Open source contributors keep formulae up to date.
- Cross‑platform: Works on macOS and Linux with minimal changes.
Not-so-good things
- Performance: Installing large packages can be slower than native installers because brew often builds from source.
- Duplication: It may install its own versions of tools that already exist on the system, leading to multiple copies.
- Learning curve: Beginners need to learn basic terminal commands and brew’s terminology.
- Limited to supported OS: Not available on Windows (though Windows Subsystem for Linux can run it).
- Occasional breakage: Updates to formulae can sometimes cause compatibility issues that require manual fixes.