Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Fix Permissions on Home-brew on MacOS High Sierra

When I tried to install python onto homebrew it downloaded it and then an error message popped up at the end that stopped it from completing. When I try to do it again it asks me to do:

$ brew link python 

After entering that the same error message appears:

permission denied @ dir_s_mkdir - /usr/local/lib

I have tried to do:

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

And I get an error message that reads:

chown: /usr/local: Operation not permitted

like image 275
Jonathan Avatar asked Nov 27 '17 14:11

Jonathan


People also ask

Does Homebrew work on M1 Mac?

Now, on your new M1 Mac, you can install Homebrew with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" . After the install is complete you'll see a message similar to the one below. Remember, Homebrew is now going to install packages in /op/homebrew/bin .

Where is homebrew installed on Mac?

On Mac Intel, Homebrew installs itself into the /usr/local/bin directory, which is already configured for access by the shell with the macOS default $PATH environment variable (the default is set by the /usr/libexec/path_helper command).


2 Answers

sudo mkdir /usr/local/Frameworks sudo chown $(whoami):admin /usr/local/Frameworks     brew link python3 
like image 185
gfly Avatar answered Sep 22 '22 11:09

gfly


sudo mkdir /usr/local/Frameworks  sudo chown $USER /usr/local/Frameworks 

And then try re-installing python. This worked absolutely fine for me.

like image 41
Shaul Hameed Avatar answered Sep 20 '22 11:09

Shaul Hameed