Homebrew: Permissions Denied Issue Fix (OS X / macOS)
source link: https://gist.github.com/irazasyed/7732946
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Homebrew Permissions Denied Issues Solution
sudo chown -R $(whoami) $(brew --prefix)/*
BradleyRan commented on Mar 19, 2021 •
sudo chmod g+w /usr/local/share/zsh/site-functions/
Life. Saved.
sudo install -d -o $(whoami) -g admin /usr/local/Frameworks
@pointum thank you so much !
mollet7 commented on May 8, 2021 •
Thank it work for me "sudo install -d -o $(whoami) -g admin /usr/local/Frameworks"
I got permission issues when upgrading my brews.
Since brew installs into /opt/homebrew/
now instead I did the following to correct the issue sudo chown -R $(whoami):staff /opt/homebrew/
and my permission issues resolved.
sudo chown -R $(whoami) /usr/local
Thank you
Excelent!, thanks
worked, thanks
AbrantesMar commented on Jul 31, 2021 •
my solution with link: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and command: sudo chown -R "$(whoami)":admin /usr/local
it ":admin" for sum in user
MacOS BigSur 11.4
Worked for me, thank you very much!
Before t looked like:
after upgrading to High Sierra, uninstall brew & re-install with the below command to ensure the linking to the brew github and associated permissions to the local folder work correctly:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
For real? Didn't work as expected at all on macOS Catalina...
How come reinstalling fixed the problem?
I still winded up having the same permission denial.
my solution with link: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and command: sudo chown -R "$(whoami)":admin /usr/local
it ":admin" for sum in user
MacOS BigSur 11.4
Chances are it's your sudo chown
bit that saved you
Reinstallation probably was never part of the equation
Is there a safe solution for my scenario?
All the clients (Macs) are in a network where all the users are logged through AD on a Windows server. Every machine has its admin user. How can I get rid of permission errors in this environment? I wouldn't like to mess up by giving permissions to these network users, they are managed as they should by other softwares and systems, such as the AD and the Avid managers (Interplay and NEXIS).
TiA
No need to
chown
the whole/usr/local
if brew only fails to create a single directory.For example, I fixed this error:
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
With this command:
sudo install -d -o $(whoami) -g admin /usr/local/Frameworks
Thanks -- it's work for me
my solution with link: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and command: sudo chown -R "$(whoami)":admin /usr/local
it ":admin" for sum in user
MacOS BigSur 11.4Chances are it's your
sudo chown
bit that saved you Reinstallation probably was never part of the equation
@Qlub53 I first did the sudo chown
part, didn't work, I then proceeded to reinstall, and my problems were gone :)
Thanks @aether2501
"sudo chown -R $(whoami) $(brew --prefix)/*"
Worked just fine for me. But can Anyone explain why there's people saying that this is a terrible solution and that they are going to Macports?
Trying to run a brew cleanup
, I kept getting errors like this one, exclusively with .DS_Store
files:
Error: Permission denied @ apply2files - /usr/local/lib/prey/versions/1.9.12/node_modules/sqlite3/lib/.DS_Store
Ended up using simply:
cd /usr/local/lib/
sudo find . -name ".DS_Store" -delete
And the next brew cleanup
ran fine.
Thanks!!! @mihkell
It works for MacOS BigSur 11.4
Well I ran this command:
sudo chown -R $(whoami) /usr/local
as well as:
chmod u+w /usr/local
And now I regret it. It's a security faux pas for the reasons others have said.
How do I change the ownership and permissions of /usr/local (and all subfolders and their contents) back to the factory defaults?
I'm running High Sierra.
Many thanks.
Here's what I did to force Homebrew to run as root:
cd /usr/local/Homebrew/Library/Homebrew
Edit brew.sh, look for "Running Homebrew as root is extremely dangerous and no longer supported" (line 250 in my version), delete the check.
Did exactly that by temporary just returning in function check-run-command-as-root() in /usr/local/Homebrew/Library/Homebrew/brew.sh
. Worked (some symlink related problems got fixed) and changed back. No more problems since then.
Worked on Monterey.
Was getting
Error: Could not cleanup old kegs! Fix your permissions on:
/usr/local/Cellar/[email protected]/7.4.16
/usr/local/Cellar/[email protected]/7.4.24
wooooow <3
I'm really expected to recursively change ownership of my entire usr/local
directory just because Homebrew told me to? A directory shared by all sorts of other applications and services? Ridiculous
Homebrew needs to work with the systems it is installing itself on. If there are permission issues then it needs to suggest sudo commands to the user that cover its specific requirements. Better yet provide a script for users to run under sudo to pre-create the dirs set permissions prior to install.
The closest I could come up with is the following. This make use of the users default group setting so other users can install homebrew utilities as well. Replace $GID if you want to use a different group, admin is a common one.
for name in Cellar Cask Homebrew Frameworks; do [ ! -d $name ] && sudo install -d -g $GID -m 0775 /usr/local/$name; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Recommend
-
127
Add homebrew bottle #5 Closed
-
38
So you are planning on learning something new — Node.js for example — and you need to download it first. You visit the project’s website, download an installer, go through the install...
-
8
Cheating To Fix Access Is Denied Error Using Get-WMIObject I was doing a little work that involved using PowerShell to get a list of printers from several remote print servers. I figured this would be a great job for WMI...
-
6
Syncing macOS Keychain certificates with Homebrew's OpenSSL One of my clients runs their own Composer repository for some packages which is hosted on internal system where the SSL is signed by an internal root...
-
10
请注意,本文编写于 818 天前,最后修改于 276 天前,其中某些信息可能已经过时。 macOS 替换 Homebrew 的源为阿里云 & 清华的源本文地址:https://blog.luci...
-
721
Description After logged into the web front end, PVE constantly asking me to login again. Since it’s impossible to stay login, I can’t upload big ISO image(like Windows), a window says Permission denied (invalid ti...
-
9
I recently got a new Macbook, and began setting up the Nix package manager to install my developer toolset. I mainly did this to try and have a working setup without installing Homeb...
-
2
Fix - Github password authentication was removed issue - MacOS/Windows Aug 14 ・1 min read...
-
8
5 Ways to Fix the “Access Denied” Error on Windows 11 By Kim Fernandez Published 15 hours ago If Windows 11 is locking...
-
8
How to Fix the Windows Access Denied Error 0x80070005 By Shaant Minhas Updated 13...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK