Homebrew/homebrew-core (no Git repository) - homebrew

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?

Related

Installing homebrew but it gives 404 errror

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)"

Can't get Node.JS to install on Mac issues with $PATH

I'm trying to push to Heroku, but the app is rejected Webpacker requires Node.js >= 6.0.0 and you are using 0.10.30. I've just done a fresh install of node.js which should be on my path /usr/local/bin.
My path is below, which looks a bit crazy to me, but I can see /usr/local/bin is in there. Where am I going wrong?
Simons-MBP:~ Simon$ echo $PATH
/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/Simon/.rvm/gems/ruby-2.4.0/bin:/Users/Simon/.rvm/gems/ruby-2.4.0#global/bin:/Users/Simon/.rvm/rubies/ruby-2.4.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/Simon/.rvm/bin
Have now installed node via Homebrew:
Simons-MBP:gourmet_coffee Simon$ brew link node
Linking /usr/local/Cellar/node/9.4.0... 7 symlinks created
Simons-MBP:gourmet_coffee Simon$ node --version
v9.4.0
Simons-MBP:~ Simon$ node --version
v9.4.0
Simons-MBP:~ Simon$ sudo chown -R $USER /usr/local
Password:
Simons-MBP:~ Simon$ brew link --overwrite node
Warning: Already linked: /usr/local/Cellar/node/9.4.0
To relink: brew unlink node && brew link node
Simons-MBP:~ Simon$ brew unlink node && brew link node
Unlinking /usr/local/Cellar/node/9.4.0... 7 symlinks removed
Linking /usr/local/Cellar/node/9.4.0... 7 symlinks created
However I'm still getting the same rejection when pushing to Heroku
Should I be adding /usr/local/Cellar to my $PATH?
Try to install from brew:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update
$ brew doctor
After that add brew location to your $PATH in your .bash_profile:
$ export PATH="/usr/local/bin:$PATH"
Search and reinstall specific version (if brew cannot search node, just run brew install node):
$ brew search node
$ brew unlink node
$ brew install node#6
$ brew link node#6
To see your current node version:
$ node --version

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.

tried installing brew it shows installed but when i type brew its showing -bash: brew: command not found

when i tried installing brew through this command
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
it showed me
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
but when I type
brew in terminal it shows
-bash: brew: command not found
Maybe brew is just not available in your path. Have you tried "uninstalling" it as told:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
And then reinstall it? Also probably closing the terminal and then reopening it could be an easy solution to make your terminal recognize a changed path

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