Homebrew: cannot symlink, / usr / local / share / man / man 7 is not writable

I install LightGBM on OSX following the installation guide . When installing cmake, Homebrew displays the following warning:

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

Then I try:

 $brew link cmake 

He 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. 
+19
source share
2 answers

Marx Setchell's suggestion to use sudo chown -R $(whoami):admin /usr/local/share/man true. On the home page search :

If the commands fail with permission errors, check the permissions of the / usr / locals subdirectories. If you don't know what to do, you can run cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var Frameworks

but Nano's suggestion to use sudo not good. According to the Home Virus Frequently Asked Questions :

Homebrew is designed to work without using sudo . You can use it, but we strongly recommend that you do not . If you used sudo and got into an error, this is likely to be the cause. Please do not send an error report if you cannot reproduce it after reinstalling Homebrew from scratch without using sudo.

+39
source

Just follow these 4 steps

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

Source: https://habr.com/ru/post/1272674/


All Articles