Homebrew install permissions issue


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?

Best Solution

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