Search code examples
homebrewmacos-high-sierra

There is no Cellar file in my usr/local dir for brew


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?


Solution

  • I solved it by creating the /usr/local/Cellar directory (and any other directories it may require) by hand and owning them.

    sudo mkdir /usr/local/Cellar
    sudo chown -R $(whoami) /usr/local/Cellar
    

    Then rerun your command.