Onega

a lot of VC++ posts, a few C# posts, and some miscellaneous stuff

Wednesday, April 03, 2019

brew on MacOs

On some system brew install cmake (or other program) reports the following errors:
Error: The following directories are not writable by your user:
/usr/local/bin
/usr/local/etc
/usr/local/sbin
/usr/local/share
/usr/local/share/doc

You should change the ownership of these directories to your user.
  sudo chown -R $(whoami) /usr/local/bin /usr/local/etc /usr/local/sbin /usr/local/share /usr/local/share/doc

And make sure that your user has write permission.
  chmod u+w /usr/local/bin /usr/local/etc /usr/local/sbin /usr/local/share /usr/local/share/doc

On my system sudo chown -R $(whoami) ... does not work. Dropping "-R" works.
sudo chown $(whoami) /usr/local/bin /usr/local/etc /usr/local/sbin /usr/local/share /usr/local/share/doc

Labels: