You upgraded to Mac OS X El Capitan and cannot use Homebrew anymore. As a developer myself who uses homebrew pretty regularly, I can totally understand the feeling.
The reason these permission issues are arising is a result of Apple's new changes to Mac OS X 10.11 El Capitan called SIP which stands for System Integrity Protector. More about SIP towards the end of this article.
Here is how you can fix the permission issues with Homebrew in Mac OS X El Capitan:
Mar 06, 2016 This is compatible with latest OSX Version (El Capitan 10.11) and it recognizes all iOS-powered devices such as iPAD Pro, iPAD Air, iPhone 6S, 6S Plus, 5 and so on, so there is no compatibility issue even if it is a homebrew. I have tried the examples found here to get Git auto-completion working on El Capitan, however none of the examples work for me. I installed bash-completion with Homebrew (brew install bash-compl. Oct 24, 2019 Mac OS X 10.11 El Capitan Setup. GitHub Gist: instantly share code, notes, and snippets. Mac OS X 10.11 El Capitan Setup. GitHub Gist: instantly share code, notes, and snippets. Homebrew can not install properly until this occurs. Install Homebrew. If this is not a fresh install of Homebrew, go ahead and purge the complete installation first. Dec 11, 2018 Download Free Mac OS X El Capitan 10.11.1 Mac Dmg. Click on the button below to start downloading Mac OS X El Capitan 10.11.1 for mac OS X. We are here to provide to clean and fast download for Mac OS X El Capitan 10.11 dmg. This link is resume able within 24 hours. Keep visiting themacgo the world of dmgs. An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article 'Homebrew and El Capitan' Make sure Homebrew has the latest formulae, so run brew update first-OR-make sure Homebrew has MySQL version 5.6.27 as default formulae in its.
If you had created the /usr/local directory already, then run this command in terminal:
sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local
And you should be all set.
Update - I have created this new guide titled - How to install Homebrew in Mac OS X El Capitan?
However, If you are doing a fresh install or cannot create /usr/local directory anymore, then follow these steps:
Step 1: Reboot into Recovery mode (Hold Cmd+R on boot) & access the Terminal. (Yes, you will have to go into recovery mode as that is the only way to disable SIP as of now.)
Step 2: In the terminal, run the following command:
csrutil disable
Step 3: Reboot back into OS X El Capitan
Step 4: Once Mac restarts, Open your Terminal and run the following command:
sudo mkdir /usr/local && sudo chflags norestricted /usr/local && sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local
Homebrew For Mac El Capitan Free
Step 5: After you have done above, you will need to reboot back into Recovery Mode once more & open the Terminal and type the following command:
csrutil enable
Step 6: Now, reboot back into OS X
Step 7: You will now be able to write to the /usr/local directory and proceed with installing Homebrew as you would regularly.
Please Note:
You need not worry about any of the steps of issues that I outlined above if you have not installed Homebrew in /usr/local or another system-protected directory.
More about SIP - System Integrity Protector:
Mac El Capitan Problems
With SIP, you can no longer write to system directories like /usr , /System and /bin even though you have root permissions or you you have logged in as the user root.
According to the Apple documentation, the /usr/local directory will have the root:wheel restricted permissions like before with every forthcoming OS X update.
Homebrew For Mac El Capitan Mac
The Homebrew team has acknowledged this issue and they will soon be adding a brew doctor check that will warn you about any of these issues in the near future.
Thanks for reading and please let me know in the comments section, if this helped you.