brew tap 是什么意思?

What does brew tap mean?

有时我看到文章在 brew install 之前说 brew tap 命令。我想知道 tap 是什么意思?为什么我必须在 install 之前 运行 tap

tap 命令允许 Homebrew 点击 另一个公式库。完成此操作后,您就扩展了可安装软件的选项。

这些额外的 Git 存储库(在 /usr/local/Homebrew/Library/Taps 内)描述了可用于安装的包公式集。

例如

brew tap                     # list tapped repositories
brew tap <tapname>           # add tap
brew untap <tapname>         # remove a tap

brew tap 向 brew 跟踪、更新和安装的公式列表添加了更多回购

brew tap <user>/<repo>https://github.com/user/homebrew-repo 的存储库进行浅克隆。请注意,brew tap 在回购名称前加上 "homebrew-" 前缀。之后,brew 将能够处理这些公式,就好像它们在 Homebrew 的规范存储库中一样

可以在 here 中找到包含所有可用选项的完整文档。

自制软件术语:

  • packageformularuby file:这通常涉及命令行 (CLI) 软件
  • bottle:已经为 macOS 构建的二进制程序(配置和 make 已经完成)
  • casks:GUI程序或字体;这是 homebrew 的扩展,允许我们安装 MacOS 原生应用程序,例如:Google Chrome (brew cask install google-chrome)、iTerm (" " iterm2)、Visual Studio Code ( " " visual-studio-code), 等. 以及安装字体: Roboto[ Mono] (" " font-roboto/" " font-roboto-mono), Latin Modern (" " font-latin-modern), 等等
  • taps:[Github|Gitlab|...] 存储库包含额外的 [下载公式] 非标准软件包,即未纳入包含所有 [公式] 的官方自制软件存储库对于可下载]包。

    "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).


  • 软件包安装到 /usr/local/Cellar/<package>,符号链接到 /usr/local/bin/usr/local/lib,等等
  • 自制核心回购公式:
    • 下载到/usr/local/Homebrew/Library/taps/homebrew/homebrew-core/formula

您可以在以下位置找到任何包裹:https://formulae.brew.sh/