简体   繁体   中英

Minor error when trying to uninstall home-brew on Mac Apple Silicon M1 chip

Im fairly new to coding and stack overflow so let me know if I do anything wrong. Basically I am following the Odin Project course and Im on the page for installing git onto my Mac. However the issue is that the command line provided to install git was actually for intel based computers and not for Apple Silicon. Im new to this stuff and was not aware of what would happen if I did install it but did not think anything would go wrong. I was so confused but still just trusted the process and went ahead and copied the default install command line into my terminal. Everything was going fine until I got this message:

Already up-to-date.
Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!

Didn't really think much of it so till I started to actually try to use it, I typed in $brew and nothing really happened and kept saying how there's no command with it. I started to panic and realise how big of a mistake I've made and now I've installed something on my laptop that I am clueless about. I did follow some other stack overflow questions and typed in some other commands. But I did this command: echo $PATH and somehow the brew command worked.

I went ahead and gave up so checked how uninstall it and typed the normal command to install but changed the end next to.sh to uninstall. This is what I got

    rmdir: /opt/homebrew: Directory not empty
Warning: Failed during: /usr/bin/sudo rmdir /opt/homebrew
Warning: Homebrew partially uninstalled (but there were steps that failed)!
To finish uninstalling rerun this script with `sudo`.
The following possible Homebrew files were not deleted:
/opt/homebrew/SECURITY.md
/opt/homebrew/etc/
/opt/homebrew/share/
/opt/homebrew/var/
You may wish to remove them yourself.

Now this is where I am confused. How the hell do I completely wipe this thing off my system. Someone please provide an answer I would be so happy and this time will do it correctly with my Apple Silicon system.

First of all, you don't have to be panic. Homebrew is well supported in apple silicon as of now (I am homebrew maintainer myself).

Based on my reading, what you need to do is to run export PATH=$PATH:/opt/homebrew/bin , this would put your brew command back in place for the terminal. If you want to use it for the following terminal sessions, you can do something like echo "export PATH=$PATH:/opt/homebrew/bin" >> ~/.bash_profile . (If you are interested, you can learn a bit about basic macos terminal stuff)

Besides, you can always run brew doctor , it would help you on finding out the right usage of homebrew.

If you still prefer to wipe out the homebrew installation. You can try this gist .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM