2

I have been trying to use brew to install tmux but every time I put in brew install tmux it would tell me:

Error: Could not create /usr/local/Cellar

Check you have permission to write to /usr/local

I then tried to do it with sudo but it did not work, which I guest would would not seeing that brew does not want to be used with root. I have already made sure that all the files that are in /usr/local belong to me. I can’t change the /usr/local file; it says: “Operation not permitted”. How can I fix this so Cellar can be created and allow me to install stuff using brew?

Update: I totally forgot that this question was up. I ended up fixing it by reinstalling Homebrew. Apparently an important thing had not been install when I first installed it. Don’t know why, but the Xcode stuff that needed to be installed for the command line. So I had to install that when I reinstalled Homebrew.

  • The script on brew's home page ought to create the Cellar directory and make it owned by you. Did you run it, or did you install brew some other way? If you ran it, were there any error messages? – Mark Plotnick Dec 29 '17 at 10:56
  • @MarkPlotnick I can’t remember exactly how I installed it, but I am sure that I installed it the regular way. I updated my question say I found how I fixed it. How to I close this question without deleting it? – StrangeRanger Dec 30 '17 at 21:59
  • To close the question without deleting it, accept an answer. You can write your own answer and accept it. – Mark Plotnick Dec 31 '17 at 1:05
0

This should work:

sudo chown -R "$USER":admin /usr/local

Also note that homebrew is designed to be used from the user account. If you use it with sudo something is wrong.

0

I ended up fixing it by reinstalling Homebrew. Apparently an important thing had not been install when I first installed it. Don’t know why, but the Xcode stuff that needed to be installed for the command line. So I had to install that when I reinstalled Homebrew.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.