Homebrew install permissions issue

Andrew Lauer Barinov picture Andrew Lauer Barinov · Mar 21, 2012 · Viewed 41.7k times · Source

I have a standard homebrew install inside of usr/local/

When I try:

Larson-2:~ larson$ brew install postgresql
Error: Cannot write to /usr/local/Cellar

And when I use sudo:

Larson-2:~ larson$ sudo brew install postgresql
Cowardly refusing to `sudo brew install'

What am I doing wrong?

Answer

jdi picture jdi · Mar 21, 2012

You somehow have limited permissions to /usr/local/Cellar. Brew doesn't like to install with sudo which is why it refuses.

Check the permissions:

ls -ld /usr/local/Cellar

Open them up for writing:

sudo chmod a+w /usr/local/Cellar