"brew link"有什么作用?

mba*_*tas 59 homebrew

当我跑步时,brew doctor我得到了一个共同的警告:

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
# [...]
Run Code Online (Sandbox Code Playgroud)

对于要取消链接的小桶意味着什么?那到底brew link做了什么?

lee*_*eor 33

brew link为您手动执行的安装创建符号链接Cellar.这使您可以灵活地自行安装,但仍然可以将这些参与作为homebrew公式中的依赖项.

有关详细信息,请参阅常见问题

您应该按照这些说明运行brew link它列出的条目.

  • 我是在回答一个更低级的答案:这些符号链接在哪里?什么/在哪里酒窖?如果您澄清这些信息,我想接受这个答案. (11认同)
  • 符号链接可以用`ls` 视为普通链接。`ls -lh /usr/local/bin/python` => `/usr/local/bin/python -> ../Cellar/python/3.6.4_3/bin/python`。对于自制软件管理的所有符号链接的完整参考,我也很好奇。Cellar 是所有 Homebrew 软件包所在的地方。它在`/usr/local/Cellar` 下。 (2认同)

the*_*eld 10

自制程序可以允许安装多个版本的公式。例如,存在称为node和的公式node@10

$ brew info node@10
...
==> Caveats
node@10 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
Run Code Online (Sandbox Code Playgroud)

如果我都nodenode@10安装,其中node为V11。我可以稍后决定通过以下方式激活早期版本brew link

$ brew unlink node

$ brew link node@10

$ cd /urs/local/bin
$ ls -l node
lrwxr-xr-x  1 user  admin  34 12 Dec 20:07 node -> ../Cellar/node@10/10.14.1/bin/node
Run Code Online (Sandbox Code Playgroud)

这里的符号链接node指向keg-only安装在中的早期版本()Cellar

  • `brew 链接 --force --overwrite node@10` (2认同)