Installing homebrew but it gives 404 errror - homebrew

I am trying to download homebrew from brew.sh for mac, but when I paste the command in the terminal it says curl: (22) The requested URL returned error: 404. The command I am using is /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". Is the download site currently down?

According to this github issue, there is an issue with Github. The Homebrew website has been updated and instead of using the HEAD branch we now use the master branch.
Instead of
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Use
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
To uninstall Homebrew, use the master branch as well
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

Related

Homebrew/homebrew-core (no Git repository)

To install I have used this
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
devansh#Devansh:~$ brew --version
Homebrew 3.6.16
Homebrew/homebrew-core (no Git repository)
but after checking the version it shows (no git repository).
How could I solve and fix it?

How to uninstall Homebrew of Rosetta and install Homebrew native on Mac Bigsu (M1)

Previously I have installed Homebrew rosetta version on MacOs M1,
now I see HomeBrew has native version, So how do I remove HomeBrew on rosetta and install the native version.
Please help me with this problem, Thanks
Uninstall Rosetta version of Homebrew
Run in rosetta mode inside terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Then install natively inside the terminal (without rosetta):
(with help of https://www.youtube.com/watch?v=nv2ylxro7rM)
cd /opt
sudo mkdir homebrew
sudo chown -R $(whoami) /opt/homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
(Add the Homebrew bin directory to the PATH if you are using zsh)
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc

Can't install Homebrew on Catalina

I have both Xcode and command line tool installed. I am trying to install Homebrew on Catalina.
Its not installing this is what I get
==> /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
What should I do?
On terminal, just run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Installing brew on Mac 10.6 results in syntax error

Running the following command from http://brew.sh/:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
...result in:
-e:192: syntax error, unexpected '.', expecting $end
.map { |d| File.join(HOMEBREW_PREFIX, d) }
^
I'm using zsh on Mac OS 10.6.
ok so to install manually through terminal do
$ cd /usr/local
$ mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
then you need to change your bash_profile like this:
$ echo 'export PATH="/usr/local/homebrew/bin:$PATH"' >> ~/.bash_profile
you might need to change permissions to the homebrew folder as well:
$ sudo chown -R $(whoami) /usr/local/homebrew
this worked for me
The official homebrew install command use some bashism. The easiest way to solve this is to run the homebrew install command with bash -c in front of it :
bash -c '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"'
Fast forward to 2020 and homebrew is no longer ruby based, but bash-based. Also, it officially only supports 10.13 or higher, while keeping an eye out for 10.9 users.
The new way to get homebrew on 10.6 or lower is by using TigerBrew:
https://github.com/mistydemeo/tigerbrew
This is a maintained fork of homebrew, with the purpose of offering support for 10.4-10.7.
After installing tigerbrew, install a newer curl: brew install curl.
That should fix any ssl issues.

How to uninstall homebrew?

I installed homebrew today without really knowing what I was doing, and now my scikit-learn package is broken. I want to undo everything that I did by uninstalling homebrew, and tried following the tips here:
https://github.com/Homebrew/homebrew/wiki/FAQ
However, I think homebrew installed into /usr/bin/local, and not /usr/bin/, so I'm not sure I can use the instructions in the link.
When I initially installed homebrew (ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"), I got the following messages:
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/lib/pkgconfig
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
Can I just delete the files in
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
I'm terrified of screwing something up in the uninstallation process.
Incidentally, would uninstalling homebrew even restore my system to what it was before? How would I go about doing that?
This worked for me
Official brew uninstalling steps:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
But /usr/bin/ruby is just symlink in order to find your ruby you need to type
which ruby
Which will give you /snap/bin/ruby
So then just use this :
/snap/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
This is covered in the homebrew FAQ:
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md#how-do-i-uninstall-homebrew
It specifies a script you can run to do it. You should run that script. As of right now, the script says something like:
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
/usr/bin/which -s git || abort "brew install git first!"
test -d /usr/local/.git || abort "brew update first!"
cd `brew --prefix`
git checkout master
git ls-files -z | pbcopy
rm -rf Cellar
bin/brew prune
pbpaste | xargs -0 rm
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
test -d Library/LinkedKegs && rm -r Library/LinkedKegs
rmdir -p bin Library share/man/man1 2> /dev/null
rm -rf .git
rm -rf ~/Library/Caches/Homebrew
rm -rf ~/Library/Logs/Homebrew
rm -rf /Library/Caches/Homebrew
Just run this code in terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Run this in the cli:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The is the updated recommended way
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
You may gout output like this:
The following possible Homebrew files were not deleted:
/opt/homebrew/Frameworks/
/opt/homebrew/bin/
/opt/homebrew/etc/
/opt/homebrew/include/
/opt/homebrew/lib/
/opt/homebrew/opt/
/opt/homebrew/sbin/
/opt/homebrew/share/
/opt/homebrew/var/
You may wish to remove them yourself.
To remove run:
sudo rm -rf /opt/homebrew
Clean as a whistle! 😚

Resources