Error when installing brew on macos big sur - macos

I install brew following
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
but not working
==> /usr/bin/sudo /bin/mkdir -p /usr/local/bin
mkdir: /usr/local/bin: Not a directory
Failed during: /usr/bin/sudo /bin/mkdir -p /usr/local/bin
Plzz help me. thanks

Related

Homebrew incompatible architecture error on M1 MacBook

I am getting below error while running /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" on my new M1 MacBook pro 16.
kevin#MacBook-Pro ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R kevin:admin /opt/homebrew
==> Downloading and installing Homebrew...
xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): tried: '/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))).
Failed during: git init -q
kevin#MacBook-Pro ~ %
This is my first time setting up development on macOS so please do let me know if I am missing something here.
Deleting /Library/Developer/CommandLineTools with sudo rm -rf /Library/Developer/CommandLineToolsand running /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Installing brew on macOS Catalina

I've encountered a problem while installing brew on my machine. The installation is a success till it creates a Homebrew directory in ~/local.
I've executed the following:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Result
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/bin
/usr/local/Homebrew
==> The Xcode Command Line Tools will be installed.
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/Homebrew
mkdir: /usr/local/bin: Not a directory
Failed during: /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/Homebrew
I've tried installing using superuser mode and the system does not allow to use the superuser mode to install files from internet source.
TIA

Homebrew installation in mac is giving error

I want to install homebrew on my mac system but i am not able to install. Installation process is giving me error.
error: could not lock config file /usr/local/Homebrew/.git/config: Permission denied
fatal: could not set 'core.repositoryformatversion' to '0'
Failed during: git init -q
I have tried below command to install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Remove the current installation with:
sudo rm -rf /usr/local/Homebrew
and install it again without using sudo:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
the location have change so now use this :
sudo rm -rf /opt/homebrew
and install again with :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Chown failure on Mac when attempting to install mobile device drivers for Appium via homebrew

After Appium did not recognize uid, I tried installing it with this command:
brew install libimobiledevice --HEAD
That gave me the following error:
Error: /usr/local/Homebrew is not writable. You should change the
ownership and permissions of /usr/local/Homebrew back to your
user account:
sudo chown -R $(whoami) /usr/local/Homebrew
Error: Permission denied # rb_sysopen - >
/usr/local/var/homebrew/locks/libimobiledevice.formula.lock
So, i copypastad and ran that chown command. It does not complain and seems to run. But, when I run the first command again, I still get the same error message.
Could someone help me resolve this?
edit:
I ran this command:
ls -ld /usr/local/Homebrew
This was the output:
drwxr-xr-x 17 1791192515 wheel 544 Mar 2 12:08 /usr/local/Homebrew
I ran this command:
ls -l /usr/local/var/homebrew/locks/libimobiledevice.formula.lock
This was the output:
No such file or directory
these are the steps I took to solve this problem
sudo chown -R "$USER":admin /usr/local
then:
sudo chown -R "$USER":admin /Library/Caches/Homebrew
then:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Before trying again to run:
brew install libimobiledevice --HEAD

Java Homebrew installation

I am trying to install Homebrew on my Mac, for use with Java development. I have followed the instructions at: https://brew.sh, and pasted the command: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" into my terminal.
When I do this, a few scripts are executed, and I get the output:
MacBook-Pro:~ me$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown me /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
HEAD is now at ea8be17 Merge pull request #2631 from GauthamGoli/audit_homepage_rubocop
==> Cleaning up /Library/Caches/Homebrew...
==> Migrating /Library/Caches/Homebrew to /Users/me/Library/Caches/Homeb
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
Error: Could not link:
/usr/local/etc/bash_completion.d/brew
Please delete these paths and run brew update.
Error: Failed to link all completions, docs and manpages:
Permission denied - (../../../Homebrew/completions/zsh/_brew_cask, /usr/local/share/zsh/site-functions/_brew_cask)
Failed during: /usr/local/bin/brew update --force
MacBook-Pro:~ me$
So the output is telling me that it's already up-to-date, presumably because I've already tried installing it once or twice?
How can I delete the paths to run brew update, like it's telling me to?
I encountered this error. The fix is to run the command sudo chown -R $USER:admin /usr/local/* as described on the Tech Stacker blog post that solves this issue.

Resources