/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
但好像没有起作用...
之后我再输入which brew
,返回/usr/local/bin/brew
再次输入/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
显示如下:
/bin/bash: line 236: /opt/homebrew/bin/brew: No such file or directory Failed to locate Homebrew!
所以我不知道该怎么卸载brew。
我的终极目标是在尝试安装brew包时不出现此错误:
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)! Please create a new installation in /opt/homebrew using one of the "Alternative Installs" from:
https://docs.brew.sh/Installation You can migrate your previously installed formula list with: brew bundle dump
我现在使用的是Apple Silicon的Mac,但我曾经使用过Intel Mac。
编辑1: 我快速查看了一下 uninstall.sh
脚本,此处
看起来我的问题是由我的操作系统安装引起的,因为我是从基于Intel的MacOS时间机器备份中进行安装的。问题在于 uninstall.sh
脚本是根据当前操作系统卸载homebrew的。因此,该脚本只能卸载我需要的ARM homebrew,而不能卸载我想要摆脱的Intel homebrew...
也许我应该尝试更改探测我是否有ARM CPU的代码行,以使脚本认为我有基于Intel的Mac,但我不知道这会不会给我的电脑带来混乱...
我很惊讶没有太多关于这个问题的答案,因为我认为我不是唯一一个从基于Intel的Mac切换到基于ARM的Mac和Time Machine。
编辑2: 我尝试用自己的命令arch -x86_64 ./uninstall_brew.sh
卸载Homebrew (我不知道这是否危险),但我不知道它是否有效...
以下是命令的输出:
user@MacBook-Pro % arch -x86_64 ./uninstall_brew.sh
Warning: This script will remove:
/Users/user/Library/Caches/Homebrew/
/usr/local/Caskroom/
/usr/local/Cellar/
/usr/local/bin/brew -> /usr/local/bin/brew
Are you sure you want to uninstall Homebrew? This will remove your installed packages! [y/N] y
==> Removing Homebrew installation...
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
Warning: Failed to delete /usr/local/Caskroom
rm: /usr/local/Caskroom: Permission denied
Warning: Failed to delete /usr/local/Cellar
rm: /usr/local/Cellar: Permission denied
==> Removing empty directories...
Password:
==> /usr/bin/sudo /usr/bin/find /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/var /usr/local/Caskroom /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks -name .DS_Store -delete
==> /usr/bin/sudo /usr/bin/find /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/var /usr/local/Caskroom /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks -depth -type d -empty -exec rmdir {} ;
==> Homebrew uninstalled!
The following possible Homebrew files were not deleted:
/usr/local/.com.apple.installer.keep
/usr/local/Frameworks/
/usr/local/Homebrew/
/usr/local/bin/
/usr/local/etc/
/usr/local/git/
/usr/local/include/
/usr/local/lib/
/usr/local/man/
/usr/local/opt/
/usr/local/remotedesktop/
/usr/local/sbin/
/usr/local/share/
/usr/local/var/
You may wish to remove them yourself.