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?
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
Do not use sudo when working with brew (for security reasons).
You've to simple set-up your permissions.
So I would go even further and change the permissions to:
sudo chgrp -R admin /usr/local /Library/Caches/Homebrew sudo chmod -R g+w /usr/local /Library/Caches/Homebrew and then apply the specific group (either admin or staff) to user which should be allowed to use brew command. Check groups of your user via: id -Gn).
If there are further issues, run: brew doctor to see what's wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With