问题描述
重新安装后,我从时光机恢复了运行10.9的Mac,但似乎某些公式的/usr/local/bin
下的符号链接丢失了.仍根据brew list $formula
来安装公式,但没有/usr/local/bin
的链接.
I restored my Mac running 10.9 from time machine after a re-install but it appears that the symbolic links under /usr/local/bin
for some of the formulas were lost. The formulas are still installed according to brew list $formula
but without the links from /usr/local/bin
.
(例如/usr/local/Cellar/findutils/4.4.2/bin/gfind
存在,但/usr/local/bin/gfind
不存在).
(e.g. /usr/local/Cellar/findutils/4.4.2/bin/gfind
exists but not /usr/local/bin/gfind
).
是否存在一种正确"的brew
方法来恢复/usr/local/bin
中的链接,还是应该只运行一个简单的find.. | xargs ln -s ...
?
Is there a "proper" brew
-way to reinstate the links from /usr/local/bin
or should I just run a simple find.. | xargs ln -s ...
?
在/usr/local/bin
下有很多其他公式的链接,可能是因为我执行了brew upgrade
,但不是全部链接.
There are quite a few links under /usr/local/bin
for other formulas, perhaps because I executed brew upgrade
, but not to all of them.
推荐答案
代替恢复符号链接,更好的方法是使用brew link
.
Instead of reinstating the symlinks, the better way to do it would be to use brew link
.
对于不在/usr/local/bin
中的给定二进制文件,例如yasm
,运行brew unlink yasm && brew link yasm
.
For a given binary which isn't in /usr/local/bin
, e.g. yasm
, run brew unlink yasm && brew link yasm
.
您可以使用xargs
对所有软件包运行此命令,如下所示:
You can run this for all of your packages using xargs
, like so:
brew list | xargs -I % sh -c 'brew unlink %; brew link %'
这篇关于还原后重新安装自制符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!