Adding a third-party Homebrew tap is like giving your package manager a secret handshake to unlock a whole new universe of software.
Let’s say you’re trying to install htop, a fantastic process viewer, but brew install htop spits back "No available formula for htop". That’s because htop isn’t in the default Homebrew core set of packages. It lives in a different "tap," a repository maintained by someone else.
Here’s htop in action. First, we’ll add the tap and then install the package:
brew tap homebrew/dupes
brew install htop
Now, if you run htop, you’ll see a colorful, interactive list of your running processes, allowing you to easily manage them.
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
1234 user 20 0 100M 10M 5000 R 5.0 1.0 0:15.23 /usr/bin/login -- user
5678 user 20 0 200M 20M 10000 S 2.0 2.0 0:30.50 /usr/bin/zsh
9012 user 20 0 500M 50M 20000 S 1.0 5.0 1:05.80 /usr/local/bin/docker
The core problem Homebrew solves is the hassle of managing software installations on macOS (and Linux). Without it, you’d be downloading .dmg files, running installers, and manually updating everything, leading to version conflicts and a cluttered system. Homebrew standardizes this, providing a consistent command-line interface.
Taps extend Homebrew’s reach. Think of the default homebrew/core tap as the main library. Third-party taps are like specialized collections or private libraries you can add to your access list. When you brew tap <user>/<repo>, you’re essentially telling Homebrew to clone a Git repository (usually from GitHub) into a specific directory within your Homebrew installation (/usr/local/Homebrew/Library/Taps/ on Intel Macs, /opt/homebrew/Library/Taps/ on Apple Silicon). Homebrew then reads the Formula files within that repository, which are Ruby scripts that define how to download, compile, and install a specific piece of software.
The brew tap command doesn’t just add a repository; it also runs brew update automatically. This is crucial because it fetches the latest information about the formulas available in the newly added tap, making them immediately installable.
To see which taps you currently have enabled, you can run:
brew tap
This will list all the tapped repositories, like:
homebrew/core
homebrew/cask
homebrew/dupes
someuser/some-cool-stuff
When you run brew install <formula>, Homebrew first checks its core taps, then iterates through all your other tapped repositories to find a matching formula. The order matters; if a formula name exists in multiple taps, Homebrew will install the one from the tap it checks first. This is why sometimes you might need to explicitly tell brew which tap to use if there’s a naming collision, like:
brew install someuser/some-cool-stuff/conflicting-formula
If you ever want to remove a tap, the command is straightforward:
brew untap homebrew/dupes
This removes the repository from your Homebrew configuration and cleans up the downloaded files.
When you brew update, Homebrew doesn’t just update formulas from the default taps; it also fetches the latest commits from all your tapped repositories. This ensures that you’re always aware of the newest versions of software available through those third-party sources. It’s a background process that keeps your package availability current across all your added sources.
A common point of confusion is that taps are just Git repositories. This means you can clone them manually, but brew tap handles the correct directory structure and registration with Homebrew, which is essential for brew update and brew install to find the formulas correctly. If you’ve manually cloned a tap into the Taps directory, Homebrew won’t recognize it until you run brew tap on it, or if it was added as part of a brew install that automatically tapped it.
When you add a tap, Homebrew fetches the Git repository and then runs git fetch --depth=1 on it. This means it only downloads the most recent commit, making the initial tap operation very fast and keeping disk usage low. It’s a clever optimization to avoid downloading the entire history of every tapped repository.
The next thing you’ll want to understand is how to create your own tap to share your custom-built software.