Macos – Changing Ownership of a directory in OS X

chownhomebrewmacos

I've installed homebrew, and am trying to change the write permissisons for the /usr/local/include directory.

When I run 'brew doctor', I get this error message:

Error: The /usr/local directory is not writable. Even if this
directory was writable when you installed Homebrew, other software may
change permissions on this directory. Some versions of the "InstantOn"
component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.

I tried doing that with chown, but I'm pretty new at this and don't think I was running it correctly. I ran:

chown myusername /usr/local/include

I didn't get any error message, but when I run brew doctor it says I still lack permission to write to /usr/local/include.

Any help would be greatly appreciated!

Edit:

I'm getting an "operation not permitted" error.

cd /usr

chown myusername local

chown: local: Operation not permitted

Best Answer

Simple solution that worked for me:

  1. click on your background to go to finder
  2. click on go and go to folder /usr
  3. right click on local and do get info
  4. unlock the lock at the bottom
  5. click + sign and add your user to the list and give read/write privileges
  6. click on the gear sign at the bottom and choose apply to enclosed items to recurse under that directory and assign privileges too all directories beneath it.

type brew doctor from command prompt to test. My result:

Your system is ready to brew.