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

大城市里の小女人 提交于 2020-07-05 04:46:30

问题


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?


回答1:


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.




回答2:


Before run any brew command do these steps:

1- $ brew update

2- brew doctor

3- If brew doctor shows the warning or error, just fix them , it also shows the solution and the command that you need so copy & paste the command & run it, that's simple

4- install what you need, for example node :

brew install node


来源:https://stackoverflow.com/questions/47256429/there-is-no-cellar-file-in-my-usr-local-dir-for-brew

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!