Homebrew: Could not symlink, /usr/local/share/man/man7 is not writable

末鹿安然 提交于 2019-12-20 10:25:45

问题


I'm installing LightGBM on OSX, following the installation guide. While installing cmake, Homebrew gives such warning message:

Warning: cmake-3.8.1 already installed, it's just not linked.

Then I try:

$brew link cmake

it gives:

Linking /usr/local/Cellar/cmake/3.8.1...
Error: Could not symlink share/man/man7/cmake-buildsystem.7
/usr/local/share/man/man7 is not writable.

回答1:


The proposition of Mark Setchell to use sudo chown -R $(whoami):admin /usr/local/share/man is right. According to the Homebrew troubleshooting page:

If commands fail with permissions errors, check the permissions of /usr/local’s subdirectories. If you’re unsure what to do, you can run cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var Frameworks

but the proposition of Nano to use sudo is not a good one. According to the Homebrew FAQ:

Homebrew is designed to work without using sudo. You can decide to use it but we strongly recommend not to do so. If you have used sudo and run into a bug then this is likely to be the cause. Please don’t file a bug report unless you can reproduce it after reinstalling Homebrew from scratch without using sudo.




回答2:


Just follow these 4 steps

  1. sudo chown -R $(whoami) $(brew --prefix)/*
  2. brew doctor
  3. brew prune
  4. brew link cmake


来源:https://stackoverflow.com/questions/44195496/homebrew-could-not-symlink-usr-local-share-man-man7-is-not-writable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!