gpt4 book ai didi

homebrew - "brew link"有什么作用?

转载 作者:行者123 更新时间:2023-12-03 05:42:59 43 4
gpt4 key购买 nike

当我运行 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:
# [...]

小桶取消链接意味着什么? brew link 到底是做什么的?

最佳答案

Homebrew 可以允许安装公式的多个版本。例如,有名为 nodenode@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.

如果我同时安装了 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

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

关于homebrew - "brew link"有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33268389/

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com