I was going to update files installed through home brew and I noticed an odd error message:
Error: unable to unlink old ‘share/man/man1/brew.1’ (Permission denied)
or something like that. That’s never happened before. /usr/local should not have a permissions problem, unless MySQL is involved somehow. (B’). I run ‘brew doctor’ on the command line and it suggests permission fixes for /usr/local/bin/, /usr/local/share, /usr/local/share/man and /usr/local/share/man/man (?). Why did this happen?
I know that “rootless” access is being enabled in OS X 10.11, El Capitan. The idea is this “System Integrity Protection” will make it difficult for malware to install itself in /System, /bin, /sbin, and /usr. However, /usr/local was supposed to be left alone. Also, I’m running Yosemite, not El Cap. Even so, I need to run my updates, so I run the following in Terminal
sudo chown -R “$USER”:admin /usr/local/bin
sudo chown -R “$USER”:admin /usr/local/share
When I run “brew update” again, my system is ready for brewing.
From what I can tell, it looks like folder permissions may be reset during each system software update. I can’t confirm it, but it makes sense. If I had problems after a system update, I would run the Disk Utility and have it repair permissions. Usually, whatever problem I had would go away. It looks like OS X wants to be helpful, but also interferes with the way I have things set up. I’ll make it work.