Fixing brew "permission denied" problem
Published 2 years and 11 months ago, Categorized under: Code, Other, Personal

Today I was trying to install a tool called mackup, which will help backup/restore your configurations to/from Dropbox.

As this is the first time for me to use it, I choose the simple way to install it, homebrew, the command was clear and simple

brew install mackup

But sadly I faced a problem with the permission to create a folder within the directory /usr/local/ which is needed to install python 3, so after I looked around, I found that the best solution will be to :

  1. Restart in rescue mode.
  2. Disable System integrity using the command csrutil disable
  3. Restart back and run the command sudo chmod -R $(whoami) /usr/local.
  4. Restart back to rescue mode.
  5. Enable System integrity using the command csrutil enable
  6. Restart back in normal mode and run the install command again.

Now running brew install mackup will work without any problem, as the core problem in my case related to the fact that virtualbox has installed some python library using root permission to python 2.7 site-packages directory, no idea what is the relationship between those two, but the trick has solved my problem, and I hope it will help you too.

Share It via: