brew package not linked 錯誤處理

brew package can't link 問題

有時候brew install [package]以後運行brew doctor自檢會出現not link錯誤ui

 ~/ 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發現:code

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

這就要求咱們改變一些系統文件夾的讀寫權限,要根據本身文件夾的實際狀況去寫dns

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

其中usrname在系統偏好設置——用戶與羣組中查找it

再運行:event

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

問題解決。table

須要注意的是:如今macOS 10.12已經禁止brew命令使用超級權限sudo

相關文章
相關標籤/搜索