Top cakebrew packages4/20/2023 Since it's the default location it's likely that's where brew will be, but is no guarantee. Then, if the which command fails, try for the default location of /usr/local/bin/brew. So in that regard it's no worse than before. This will solve the problem that the search for brew will always fail if the user's login shell isn't /bin/bash. If brew isn't found, see if it's in /usr/local/bin/brew.But one that is a tad better than what we have could be: You always have to make some assumptions, but assuming the login shell is bash isn't a very good one (even if it's only implied, not explicit). The current behavior says "I'll use whatever the login shell is for this user, and hope that $SHELL -l -c "which brew" will do the right thing." This seems to be a more elegant, precise solution in my opinion.Right, and "hoping for the best" was what my comment aims to avoid, and is what the current behavior does. Instead, Cellar, Caskroom, Frameworks, Homebrew, etc. Which installs Homebrew inside /usr/local without changing ownership of /usr/local itself. For example, I have files related to maven and mySQL in /usr/local.Ī more precise solution is to follow the instructions to install Homebrew, given at the Homebrew GitHub site, namely /bin/bash -c "$(curl -fsSL )" It affects your whole machine and other software may also be using /usr/local. Secondly, however, taking a step back, if the main concern is to install or upgrade Homebrew, rather than wanting to change the permissions for /usr/local per se, then it may be overkill (like taking a sledgehammer to hammer a nail) to change the permissions for /usr/local. Hence, the popular answers above cannot be used. For example: $ sudo chown -R "$USER":wheel /usr/localĬhown: /usr/local: Operation not permitted It also tells you exactly what it intends to do before doing it.įirstly, with MacOS Catalina, the basic ways to change the ownership of /usr/local are no longer allowed. Instead of doing a chmod to your user, it gives the admin group (to which you presumably belong) write access to the specific directories in /usr/local that homebrew uses. # Non-distructively move any git crud out of the wayĮcho Stashing changes in "$BREW_ROOT". Sudo chgrp -R "$BREW_GROUP" "$BREW_ROOT/$dir" # Non-recursively update the root brew path.Įcho Recursively updating "$BREW_ROOT/$dir". Read -p 'Press any key to continue or CTRL-C to abort.'Įcho "You may be asked below for your login password."
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |