how to uninstall homebrew using an arm based Mac? - macos

I installed homebrew today. And I did something wrong so that my homebrew can't work now. Since I use an arm based mac, I am hard to find solution to uninstall my homebrew which installed in /opt/homebrew/.

To uninstall Homebrew, run the uninstall script from the Homebrew/install repository.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Download the uninstall script and run /bin/bash uninstall.sh --help to view more uninstall options.

Make sure your homebrew path is correct and then run the script:
echo $HOMEBREW_PREFIX #=> /opt/homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
See: https://github.com/homebrew/install#uninstall-homebrew

Related

mac install ruby failed. Error running '__rvm_make -j4'

when I executed "rvm install 2.7.2" in the terminal, I got the Error running '__rvm_make -j4',If anyone can help, I would appreciate it
using macOS BigSur had the same problem, this worked for me:
CFLAGS="-Wno-error=implicit-function-declaration" rvm install x.x.x
This helped for me: https://github.com/rvm/rvm/issues/5043#issuecomment-967000943
Copy below:
Right click Terminal from the Application/Utilities folder, Get Info, tick the "Open using Rosetta" box.
Uninstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
rm -rf /opt/homebrew/*
sudo rm -rf /opt/homebrew
Reinstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Restart terminal
Check Homebrew is working fine: brew doctor
Reinstall openssl: brew install openssl
Install Ruby: rvm install 2.7 Or any version

Cannot install Homebrew in Mac Sierra

I have a problem installing homebrew in mac sierra.
I followed the instructions from this link:
https://coolestguidesontheplanet.com/installing-homebrew-on-macos-sierra-package-manager-for-unix-apps/
This is the command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
The link exists but when I type this in the terminal, I encounter this error:
curl: (35) Server aborted the SSL handshake
Can anyone suggest a solution to this?
Many thanks, Ill appreciate any help.
https://raw.githubusercontent.com/Homebrew/install/master/install
Open the link in browser and save the file as install.rb.
Then run
ruby install.rb
I run into this issue, and it is caused by the network unstabitily.
My solution is:
Uninstall the homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Then install it again:
ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It works for me.
Have you tried xcode-select --install before that command? This solution may work on some systems.
Another potential issue is your curl maybe too old. Upgrade to 7.46+ may solve this. You have to build curl from scratch if so.
If nothing helps, and you really want to install brew without second thought, try adding --insecure after -fsSL.
At last, you can always pull the git repo and install manually.
Please use this to install homebrew in MacOS, previous one was deprecated.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Mac - Can’t install Homebrew

I tried to install Homebrew like this:
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
It didn’t install correctly so I closed Terminal and tried again. Now it displays me the following message:
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
I tried to do that but without success. The following message is displayed:
brew: command not found
So, the problem is that Homebrew is installed but actually it is not installed. Any suggestions how to solve this problem? Thank you!
This seems to have resolved the issue for me
rm -rf /usr/local/Cellar /usr/local/.git
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Afterward, I can now
brew doctor
You may also find the gist linked to at the following page of use:
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md
The URL contained in the command you are using is not correct. Ruby will dump out lines of HTML and then fail. Use this command instead:
ruby -e "$(curl -fsSkL raw.github.com/Homebrew/homebrew/go/install)"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
this is work for me!
This worked for me:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
I removed the folder /usr/local/.git and homebrew installed just fine afterwards.
What was the message given when it didn't install correctly the first time? Is the brew binary present in /usr/local/bin ? If so, you probably just need to add it to your path, see: Error Installing Homebrew - Brew Command Not Found
Attempting to resolve the same issue, I found out that I had mistyped while making changes to my PATH. I did not have /usr/local/bin. I would then recommend running
$ echo $PATH
in terminal to see if you have the correct directories.You can also run
$ vi ~/.bash_profile
to see it and make changes if neccessary
If you cannot install by using curl try to open the install script from your browser, save it in a file called i.e brew_install.rb somewhere on your disk and run the script locally
ruby brew_install.rb
This worked for me.
Follow these steps
1 ==> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
2 ==> sudo rm -rf /usr/local/Homebrew/
sudo rm -rf /usr/bin/Homebrew/
3 ==> install brew
1 -- /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2 -- sudo chown -R $(whoami) /usr/local/var/homebrew
If get these error try below command
Error: Failed to link all completions, docs and manpages:
sudo chown -R $(whoami) /usr/local/*
then follow these commands
/usr/local/bin/brew update --force
This is the most recent one that works for me.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I found it here in case it is updated later. https://brew.sh/

Error Installing Homebrew - Brew Command Not Found [duplicate]

This question already has answers here:
Installing Homebrew on macOS
(24 answers)
Closed 2 years ago.
I've spent the bulk of my Friday trying to get the latest version of Ruby installed on my new MacBook Air (w/ Mountain Lion installed).
I have all the latest versions of XCode and command line tools. But I can't seem to get Homebrew to work! Here's a screenshot of where I keep getting stuck (I'm a new user, so can't embed this image).
As you can see I used the following to instal Homebrew:
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go/install)"
While there was a "warning" it seemed as though the installation worked:
Warning: /usr/local/bin is not in your PATH.
==> Installation successful!
Despite that, when I try to run "brew doctor" I received the following:
-bash: brew: command not found
Again, I'm trying to install homebrew, so i can instal the latest version of ruby -- I'm looking to learn to code in ruby, but kind of screwed if I can even get a development environment running! :)
The warning is telling you what is wrong. The problem is that brew is kept in /usr/local/bin
So, you can try /usr/local/bin/brew doctor
To fix it permanently alter your bash profile (.bashrc or .profile in your home directory) and add the following line:
export PATH=/usr/local/bin:$PATH
On Apple silicone it's
export PATH=/opt/homebrew/bin/:$PATH
Check XCode is installed or not.
gcc --version
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update
http://techsharehub.blogspot.com/2013/08/brew-command-not-found.html "click here for exact instruction updates"
nano ~/.profile
add these lines:
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
save the file:
Ctrl + X then Y then Enter
then render the changes:
source ~/.profile
This was just happening to me, but none of the suggestions above worked. I changed directories ("cd ~/tmp") and suddenly the command
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
worked for me. Prior to changing directories I had been in a directory that is a Git repository. Perhaps that was interfering with the ruby and Git commands in the Brew install script.
You can run in terminal
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
then install https://github.com/robbyrussell/oh-my-zsh.
When those complate run i.e pico editor pico .zshrc and past those lines:
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
remember use brew doctor :)
try this
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"
You can use this:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
to install homebrew.

What is the best/safest way to reinstall Homebrew?

I am getting issues with permissions in Homebrew: After I installed Node and tried to install npm using the curl command Homebrew tells you to use, it would fail due to EACCESS errors. I checked the node folder and the permissions were a) unowned by a user (I had to chown it) and b) Had no write permissions (I had to chmod 755 it).
I've fixed the issue with NPM, but I had to run its install script as sudo (which is bad!).
I assume I must have installed Homebrew as root or something similar. I am hoping that reinstallation will fix it, but I can't find a source on how to reinstall Homebrew.
When I rerun the installer in Terminal I get:
/usr/local/.git already exists!
Update 10/11/2020 to reflect the latest brew changes.
Brew already provide a command to uninstall itself (this will remove everything you installed with Homebrew):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
If you failed to run this command due to permission (like run as second user), run again with sudo
Then you can install again:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Process is to clean up and then reinstall with the following commands:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )"
Notes:
Always check curl | bash (or ruby) commands before running them
http://brew.sh/ (for installation notes)
https://raw.githubusercontent.com/Homebrew/install/master/install (for clean up notes, see "Homebrew is already installed")
Try running the command
brew doctor
and let us know what sort of output you get
edit: And to answer the title question, this is from their FAQ :
Homebrew doesn’t write files outside its prefix. So generally you can
just rm -rf the folder you installed it in.
So following that up with a clean re-install (following their latest recommended steps) should be your best bet.
For Mac OS X Mojave and above
To Uninstall Homebrew, run following command:
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
To Install Homebrew, run following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And if you run into Permission denied issue, try running this command followed by install command again:
sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*
The way to reinstall Homebrew is completely remove it and start over. The Homebrew FAQ has a link to a shell script to uninstall homebrew.
If the only thing you've installed in /usr/local is homebrew itself, you can just rm -rf /usr/local/* /usr/local/.git to clear it out. But /usr/local/ is the standard Unix directory for all extra binaries, not just Homebrew, so you may have other things installed there. In that case uninstall_homebrew.sh is a better bet. It is careful to only remove homebrew's files and leave the rest alone.
For me, I need to do the below steps to re-install the brew from scratch.
sudo rm -rf /usr/local/Cellar/
brew cleanup
sudo rm -rf $(brew --repo)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
You can try this method for M1 macbook
After you
1.Uninstall brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
2.Install brew again
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
3.You brew install something in image I "brew install sonar-scanner"
then error log show same this
Error: No similarly named formulae found.
4.You should try follow run this.
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
5.When no.4 is done run this
brew tap homebrew/core
try brew install again.
For me, this one worked without the sudo access.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
For more reference, please follow
https://gist.github.com/mxcl/323731

Resources