Skip to content

Install Homebrew on your Mac (fallback package manager)

Why install Homebrew?

While your Mac comes preloaded with many useful apps, its shell utilities are quite limited. That's where Homebrew comes in—it's often described as the "missing package manager for Mac." Homebrew allows you to easily install additional shell utilities and apps, such as wget, that aren't included by default.

However, Homebrew should be used as a fallback option. The recommended approach is to use:

  1. uv tool install for Python-based CLI tools
  2. pixi global install for other binaries
  3. Homebrew only when the above options fail

This approach gives you better isolation and version control while avoiding potential conflicts with system packages.

When to use Homebrew

Use Homebrew when:

  • A tool isn't available through uv tool install
  • A tool isn't available through pixi global install
  • You need a system-level package that requires root privileges
  • You're working with tools that have complex dependencies

How to install Homebrew

First, check if Homebrew is already installed:

which brew

If this command returns a path (like /opt/homebrew/bin/brew), then Homebrew is already installed and you can skip the installation.

If Homebrew isn't installed, follow the instructions on the official Homebrew website. In essence, it boils down to running a single bash command. For your convenience, here's the command you'll need:

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

You can execute this command from any directory, but just to be extra safe, the command above navigates to your home directory first. Copy/paste the command above into your terminal, and hit enter. That's it; Homebrew will take care of the rest.

Using Homebrew on Linux

Linux systems typically come with their own package managers — apt for Ubuntu and yum for CentOS, to name a few. If you have the necessary privileges (e.g., sudo access), these native package managers should suffice for most tasks, and you likely won't need Homebrew.

However, if you're working in an environment where you lack sudo privileges—such as on a managed system or high-performance computing cluster—Homebrew can be a lifesaver. Installing it in your home directory allows you to access a wide range of utilities without requiring administrative permissions.

To summarize, while Homebrew may not be essential for all Linux users, it's an excellent tool for those in restricted environments.

See also