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

Viewed 19729

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.
2 Answers

Just follow these 4 steps

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