homebrew 检查二进制包可用性

homebrew check binary package availability

是否有 brew 命令来检查我要安装的公式是否以二进制形式提供,或者我必须从源代码安装它。

作为推论,如果我需要通过使用 brew install --build-from-source XXXX 重新编译来安装特定公式,那么该特定公式所依赖的所有包也将从源代码重建吗?

谢谢

brew info <formula> 会告诉您给定的配方是否已为您的系统装瓶(=编译),例如:

$ brew info postgresql | head -n 1
postgresql: stable 9.5.1 (bottled)

您可以使用 --json=v1 获取更多信息:

# bottled formula
$ brew info --json=v1 postgresql | jq '.[0].bottle'
{
  "stable": {
    "revision": 0,
    ...
  }
}

# non-bottled formula
$ brew info --json=v1 docker-machine-nfs | jq '.[0].bottle'
{}

if I need to install a particular formula by recompiling it with brew install --build-from-source XXXX all the packages on which that particular formula depend will be rebuilt from source too?

只会从源代码构建您还没有的依赖项。