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)"
If the steps here https://github.com/homebrew/install#uninstall-homebrew do not work, it's probably because you installed Homebrew using Rosetta, and you are trying to remove it without using Rosetta. (To verify, navigate to /Applications/Utilities/Terminal.app
, right click and select Get Info)
When using Rosetta, you won't pass the check for arch -arm64
in the script.
You can probably have the same issue if you try to remove a Homebrew installed with Rosetta with Terminal not using Rosetta.
© 2022 - 2025 — McMap. All rights reserved.
echo $HOMEBREW_PREFIX
returned the right value but I still got an error:Failed to locate Homebrew!
. Fixed it by addingarch -arm64
in front of the install command. – Upturned