403

Sometimes I see articles saying command of brew tap before brew install something. I am wondering what does tap mean? And why must I run tap before install?

Les
  • 3,150
  • 4
  • 29
  • 41
Zhang Buzz
  • 10,420
  • 6
  • 38
  • 47
  • 21
    It is to access other repositories that are not included in Homebrew's master repository. You must tap before installing a package that is from another repository. You can see all current taps with `brew tap`. – Caleb Dec 22 '15 at 04:14
  • 15
    The other comment is correct, but by way of explanation, when you *tap* a resource, you gain access to it. But it is also another beer/brewing reference (as is `homebrew`) because when you *tap* a keg of beer you are essentially knocking a valve into it to *"gain access to the beer"*. – Mark Setchell Dec 22 '15 at 08:20
  • 19
    If you are confused by the multitude of beer-related verbs, as I am, there is a [glossary](https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md#homebrew-terminology). – Andrew M Dec 06 '16 at 23:37
  • The only good thing about brew's name is that it's short – Niall Connaughton Oct 23 '17 at 16:44
  • 2
    Why is this on StackOverflow? It's not about writing code -- [unix.se] or [apple.se] are more obviously appropriate. – Charles Duffy Jan 09 '18 at 20:27
  • it just "links" to another repository. they should have called it "link" or "connect to repository", but they wanted to be cute :) it's "tap" in the sense of a verb .. "tap in to". – Fattie Nov 25 '18 at 10:46
  • 2
    for people coming from ubuntu (linux) this is equivalent to external PPA – Sudip Bhandari Feb 12 '20 at 03:39

3 Answers3

399

The tap command allows Homebrew to tap into another repository of formulae. Once you've done this you've expanded your options of installable software.

These additional Git repos (inside /usr/local/Homebrew/Library/Taps) describe sets of package formulae that are available for installation.

E.g.

brew tap                     # list tapped repositories
brew tap <tapname>           # add tap
brew untap <tapname>         # remove a tap
swrobel
  • 4,053
  • 2
  • 33
  • 42
Snowcrash
  • 80,579
  • 89
  • 266
  • 376
  • 14
    `brew cask` seems to add the `caskroom/cask` repo. Is that a shortcut and essentially the same as `brew tap caskroom/cask` ? – skube Nov 15 '16 at 18:48
  • 12
    So this means `brew tap` will add an unofficial, third-party repository? – wisbucky May 09 '17 at 22:04
  • 1
    how do you list the formulae from a certain tap? – evdama Nov 23 '17 at 19:33
  • 3
    For me the path was /usr/local/Homebrew/Library/Taps – Carl Pritchett May 12 '18 at 05:42
  • 2
    "..repository of formulae", what's meaning of formulae ? – vikramvi Sep 03 '19 at 01:12
  • @vikramvi a package definition written in Ruby, essentially a ruby file that can be created by `brew create ` in which the URL is a zip/tarball. Those ruby files use the Formula API. it provides instructions and metadata for Homebrew to install a piece of software. and they all are Formula class. – ShifraSec Oct 05 '22 at 20:14
54

brew tap adds more repos to the list of formulae that brew tracks, updates, and installs from

brew tap <user>/<repo> makes a shallow clone of the repository at https://github.com/user/homebrew-repo. Note that brew tap prefixes the repo name with "homebrew-". After that, brew will be able to work on those formulae as if they were in Homebrew's canonical repository

The full documentation can be found here with all the available options.

Jaime Bellmyer
  • 23,051
  • 7
  • 53
  • 50
Mehdi Ijadnazar
  • 4,532
  • 4
  • 35
  • 35
49

Homebrew Terminology:

  • packageformularuby file: this typically deals with command line (CLI) software
  • bottle: binary program already built for some OS (macOS montery, macOS big_sur, arm64_monterey, arm64_big_sur, catalina, x86_64_linux) (configurations and make is already done)
  • casks: GUI program or font; this is an extension of homebrew that allows us to install MacOS native applications like: Google Chrome (brew cask install google-chrome), iTerm (" " iterm2), Visual Studio Code (" " visual-studio-code), etc. As well as install fonts: Roboto[ Mono] (" " font-roboto/" " font-roboto-mono), Latin Modern (" " font-latin-modern), etc.
  • taps: [Github|Gitlab|...] repositories containing additional [formulas for downloading] packages that are not standard, i.e not incorporated into the official homebrew repository containing all [formulas for downloadable] packages.

    "taps" allow you to extend the list of packages that you can install via homebrew. by "tapping" a repository you download (literally git clone) the repository locally. the repository wil contain ruby files (formulas) that tell homebrew how to download, configure, build, install, etc, an additional list of packages. then when you do brew install X, brew will scan through the official/standard homebrew repositories that you have locally, won't find a formula for X, then it will scan through your "taps" and if it finds a formula for X, will run it (the formula is a ruby file).


  • Packages are installed into /usr/local/Cellar/<package> with symlinks into /usr/local/bin and /usr/local/lib, etc.
  • Homebrew core repo formulae:
    • downloaded to /usr/local/Homebrew/Library/taps/homebrew/homebrew-core/formula

You can find any package at: https://formulae.brew.sh/

8c6b5df0d16ade6c
  • 1,910
  • 15
  • 15