Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Error: Cannot write to /usr/local #3930

Closed
x2on opened this issue Jan 18, 2011 · 14 comments
Closed

Error: Cannot write to /usr/local #3930

x2on opened this issue Jan 18, 2011 · 14 comments

Comments

@x2on
Copy link
Contributor

x2on commented Jan 18, 2011

I can't install any formula.

I get always this error message:
brew install wget
Error: Cannot write to /usr/local

I installed brew with:

 ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"

I installed git with brew without problems.
But now i can't install any formula with brew install xyz

@x2on
Copy link
Contributor Author

x2on commented Jan 18, 2011

sudo chmod g+w /usr/local
sudo chgrp staff /usr/local

And it works... Perhaps the install script doesn't this correctly?

@fannar
Copy link

fannar commented Feb 4, 2011

@X20N: This fixed it for me. I just did brew update and then the permission problem appeared. Something broken in brew.

@ghost
Copy link

ghost commented Mar 30, 2011

Can this be of help?:

alias fixbrew='sudo chown -R $USER /usr/local'

@adamv
Copy link
Contributor

adamv commented Apr 5, 2011

Did MindTooth's command help?

@adamv adamv closed this as completed Apr 5, 2011
@alexbuijs
Copy link

I had a similar problem and for me MindTooth's command did fix it

@leshill
Copy link
Contributor

leshill commented May 6, 2011

Just as an FYI, some OSX installs like 'Instant On' which comes with Airfoil 4.0.2 will reset permissions on /usr/local.

@adamv
Copy link
Contributor

adamv commented May 6, 2011

You should write to Airfoil and tell them to stop doing that.

On Fri, May 6, 2011 at 3:57 PM, leshill
reply@reply.github.com
wrote:

Just as an FYI, some OSX installs like 'Instant On' which comes with Airfoil 4.0.2 will reset permissions on /usr/local.

Reply to this email directly or view it on GitHub:
#3930 (comment)

@leshill
Copy link
Contributor

leshill commented May 6, 2011

Have done, wanted it in the thread just in case someone else ran into it.

@dareiff
Copy link

dareiff commented May 8, 2011

I think that's exactly what happened to me, leshill. Thanks!

@kch
Copy link
Contributor

kch commented Jun 19, 2011

shouldn't brew doctor detect this?

leshill added a commit to leshill/homebrew that referenced this issue Jun 19, 2011
- Airfoil during the install of InstantOn changes /usr/local to
  root:wheel ownership
- [closes Homebrew#3930]
@joshuajabbour
Copy link
Contributor

Both x2on and MindTooth's solutions work. Is there a preferred one? Wouldn't x2on's allow other admins to install too?

(I commented here on this old issue because this is still a problem on a brand-new Mac w/ Lion. Posting this "fix" somewhere more accessible might be helpful.)

@strangnet
Copy link

I had the same issue on Lion, but only changing permissions and ownership wasn't enough. Not until I manually created /usr/local/Cellar was I able to run brew install wget and get it to work.

@Artform
Copy link

Artform commented Mar 12, 2013

Deleting /usr/local/Cellar/ and manually creating it worked for me. I'm still having other issues installing on Mountain Lion.

@devmanuj
Copy link

This worked for me:
sudo chown -R $(whoami):admin /usr/local

@Homebrew Homebrew locked and limited conversation to collaborators Oct 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.