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
brew
命令使用超級權限sudo