Installing brew on macOS Catalina - macos

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

Related

M1 Mac Problem Installing Homebrew hangs at installing XCode

I need to install homebrew to install different software packages in my computer.
However, I first tried using homebrew and got
zsh: command not found: brew
I then tried fixing this issue following different methods such as adding opt/homebrew/bin/ to the PATH, adding export PATH="$PATH:/opt/homebrew/bin/"
to my ~/.zshrc file but nothing worked. One of the methods required me to errase the folder /opt/homebrew and then install homebrew via /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" (specified in brew.sh website). This hangs during the installation. This is the output shown in my command line
~ % /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
==> The following new directories will be created:
/opt/homebrew/bin
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
/opt/homebrew/opt
/opt/homebrew/share/zsh
/opt/homebrew/share/zsh/site-functions
/opt/homebrew/var/homebrew
/opt/homebrew/var/homebrew/linked
/opt/homebrew/Cellar
/opt/homebrew/Caskroom
/opt/homebrew/Frameworks
==> The Xcode Command Line Tools will be installed.
Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/bin/install -d -o root -g wheel -m 0755 /opt/homebrew
==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /bin/chmod ug=rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /bin/chmod go-w /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown alchandeck /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/sbin/chown -R alchandeck:admin /opt/homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
We can see the installation hangs when trying to install XCode Command Line Tools. So, I then tried to install XCode different ways but got no luck either. Please help me figure out how to install homebrew so I can start developing in my computer! Thanks!
Blockquote
Edit:
After a while of waiting, the Xcode installation timed out (not surprised) and showed me this:
Timed out while loading data from the Apple Software Update server.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:
==> Installing the Command Line Tools (expect a GUI popup):
==> /usr/bin/sudo /usr/bin/xcode-select --install
xcode-select: note: install requested for command line developer tools
Press any key when the installation has completed.
I was finally able to solve it by following this post https://github.com/Homebrew/discussions/discussions/131
I basically downloaded the version of Command Line Tools that was compatible with my macOS version and then proceed as normal with my brew install command provided in brew.sh
The only caveat is that when I ran the brew install command, I was prompted with a message saying I had not agreed with the Terms and Conditions of the Command Line Tools, which was fairly easy to do any ways. After agreeing, I tried running the brew install command again and was able to install it.

Error when installing brew on macos big sur

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

Homebrew installation presented with error

On installation of homebrew I am presented with this error, could someone please explain what is happening and the solution?
==> 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
==> Downloading and installing Homebrew...
fatal: cannot copy '/usr/local/Cellar/git/2.19.1/share/git-core/templates/hooks/fsmonitor-watchman.sample' to '/usr/local/Homebrew/.git/hooks/fsmonitor-watchman.sample':
Permission denied
Failed during: git init -q
You have to give Homebrew the right to write inside /usr/local. To do this the official command to run is:
cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks
Read the official troubleshooting page of Homebrew for details.
If you have not installed applications in /usr/local that rely on specific permissions, you can also run:
sudo chown -R $(whoami) /usr/local/*

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.

xcode-select command not found

I was trying to install homebrew on my mac but failed with the error message saying that xcode-select command not found. I did some searchings online and realized that there is one duplication online. However, it doens't provide me a solution. Below is the information about my environment and settings.
I have xcode5.1.1 and xcode6beta6 both installed on the osx mavericks.
I checked the PATH variable by "echo $PATH" and the result is "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin".
I downloaded the command line tool from the apple download page and installed it.
Last, I run the command "ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" to install the homebrew.
Results I got:
"==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==> Installing the Command Line Tools (expect a GUI popup):
==> /usr/bin/sudo /usr/bin/xcode-select --install
sudo: /usr/bin/xcode-select: command not found
Failed during: /usr/bin/sudo /usr/bin/xcode-select --install
"
I have spent a whole day trying to solve the problem. Anyone please help. A lot of thanks.

Resources