brew package not linked 错误处理

 阅读约 2 分钟

brew package can't link 问题

有时候brew install [package]之后运行brew doctor自检会出现not link错误

 ~/ 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:
  libevent

运行brew link发现:

~/ brew link libevent
Linking /usr/local/Cellar/libevent/2.1.8...
Error: Could not symlink include/evdns.h
/usr/local/include is not writable.

这就要求我们改变一些系统文件夹的读写权限,要根据自己文件夹的实际情况去写

sudo chown -R usrname:admin /usr/local/
sudo chown -R usrname:admin /usr/include/
sudo chown -R usrname:admin /Library/...

其中usrname在系统偏好设置——用户与群组中查找

再运行:

 ~/ brew link libevent
Linking /usr/local/Cellar/libevent/2.1.8... 817 symlinks created

问题解决。

需要注意的是:现在macOS 10.12已经禁止brew命令使用超级权限sudo

阅读 1.1k发布于 2017-02-07
推荐阅读
学习记录
用户专栏

python,linux,mac学习记录,资料整理

3 人关注
4 篇文章
专栏主页
目录