For those of you using OS X El Capitan, your problem may be System Integrity Protection.
If /usr/local
exists already, run the following in Terminal:
sudo chown -R $(whoami):admin /usr/local
If /usr/local
does not exist:
First, try to create /usr/local
the normal way:
sudo mkdir /usr/local && sudo chflags norestricted /usr/local && sudo chown -R $(whoami):admin /usr/local
If you see permission issues instead try:
- Reboot into Recovery mode (Hold Cmd+R on boot) & access the Terminal.
- In that terminal run:
csrutil disable
- Reboot back into OS X
- Open your Terminal application and execute the line from just above
- Reboot back into Recovery Mode & access the Terminal again.
- In that terminal execute:
csrutil enable
- Reboot back into OS X & you'll be able to write to /usr/local & install Homebrew.
sudo
, so you should be able to runbrew update
without it.sudo
for Homebrew