Fix ‘cannot write’ homebrew error on Mac

I have been using Mac terminal to get a MAMP setup done lately and I kept running back in to and error I spent a lot of time trying to fix a while ago…sigh. This comes up when you try to install or update with brew.

Irshads-MBP:~ Ishy$ brew upgrade
Error: Cannot write to /usr/local/Cellar

Fix it this way:

sudo chown -R $USER /usr/local

Note: You can replace $USER to root as homebrew is better set with root.

brew2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s