我可以在macos苹果硅上卸载啤酒

发布于 2025-02-13 12:50:06 字数 3710 浏览 1 评论 0原文

就像这里提到的一样我输入的
how-do-i-uninstall-homebrew /bin/bash -c“ $(curl -fssl https://raw.githubusercontent.com/homebrew/install/head/head/uninstall.sh)”,但似乎不起作用.. 。

/bin/bash -c“ $(curl -fssl https://raw.githubusercontent.com/homebrew/install/head/head/uninstall.sh)”

显示:

/bin/bash:第236章:/opt/homebrew/bin/brew:没有这样的文件或目录 无法找到自制!

所以我不知道该怎么做才能卸载啤酒。

我的最终目标是当我尝试安装啤酒包时不遇到此错误:

错误:不能在英特尔默认的ARM处理器上安装在Homebrew中 前缀(/usr/local)!请在 /OPT /Homebrew中创建一个新的安装 使用:
的“替代安装”之一 https://docs.brew.sh/installation 您可以先前迁移 安装的公式列表,带有以下方式:酿造捆绑转储

我现在有一个带有Apple Silicon的Mac,但我曾经有一个Intel Mac。

编辑1:我快速查看uninstall.sh.sh脚本 https://raw.githubusercontent.com/homebrew/install/head/head/uninstall.sh.sh

看来我的问题是由我的OS安装引起的,因为我从基于Intel的MacOS中做到了时间机备份。问题是unstall.sh根据当前的操作系统编程以卸载Hommbrew。因此,此脚本只能卸载我需要的手臂自制手臂,并且不能卸载我试图摆脱的英特尔自制的……

也许我应该尝试更改检测到的代码行脚本认为我有一个基于Intel的Mac,但我不知道它是否可以在我的计算机中带来混乱...

我很惊讶这个问题没有太多答案,因为我不认为我是唯一的一个从基于英特尔的Mac转换为基于ARM的Mac的人与时机。

编辑2:我试图用自己的ARCH -X86_64 ./uninstall_brew.sh.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.

Like it is mentioned here https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew I typed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" but it doesn't seem to work...

When I type afterwards which brew it returns /usr/local/bin/brew

and when I type again /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

It displays :

/bin/bash: line 236: /opt/homebrew/bin/brew: No such file or directory
Failed to locate Homebrew!

So I don't know what to do to uninstall brew.

My ultimate goal is to not getting this error when I try to install a brew package :

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

I now have a Mac with Apple Silicon but I used to have a Intel Mac.

EDIT 1 : I took a quick look at the uninstall.sh script here https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh

It seems that my problem is induced by my os installation because I did it from an Intel-based MacOS time machine backup. The problem is the uninstall.sh script is programed to uninstall homebrew according to the current os. So this script can only uninstall the ARM homebrew that I need and can't uninstall the Intel homebrew I try to get rid of...

Maybe I should try to just change the line of code that detect I have a ARM CPU to make the script think I have a Intel-based Mac but I don't know if it could bring chaos in my computer...

I'm surprised there's not a lot of answers about this problem since I don't think I'm the only one to have switched from Intel-based Mac to ARM-based Mac with Time Machine.

EDIT 2 : I tried to uninstall Homebrew with a command of my own arch -x86_64 ./uninstall_brew.sh (I have no idea if it's not DANGEROUS) but I don't know if it worked well...

Here is the output of the command :

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

爱你是孤单的心事 2025-02-20 12:50:06

尝试运行:path =/usr/local/bin:$ PATH ARCH -X86_64/bin/bash -c“ $(curl -fssl https://raw.githubusercercontent.com/homebrew/homebrew/install/install/head/head/uninstall。 sh)“

在这里找到答案: https://github.com/homebrew/discussions/discussions/discussions/3437

Try running: PATH=/usr/local/bin:$PATH arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

Found the answer here: https://github.com/Homebrew/discussions/discussions/3437

久隐师 2025-02-20 12:50:06

我在M1 MBP上遇到了类似的问题,发现更改脚本中的卸载路径可能会起作用。

首先,我下载卸载脚本的本地副本

curl -O https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh

,然后在本地运行脚本,然后将路径设置为/user/local(这是Intel Mac上的默认路径),

/bin/bash uninstall.sh --path=/usr/local

但它完成了2个警告。我不确定它们是什么

Warning: Failed during: /usr/bin/sudo rmdir /usr/local
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:
/usr/local/Cellar/
/usr/local/Frameworks/
/usr/local/Homebrew/
/usr/local/bin/
/usr/local/etc/
/usr/local/include/
/usr/local/lib/
/usr/local/opt/
/usr/local/sbin/
/usr/local/share/
/usr/local/texlive/
/usr/local/var/
You may wish to remove them yourself.

,我会手动删除这些文件。

(这是我第一次回答堆栈溢出的东西。希望这有所帮助!)

I encounter similar issue on my M1 MBP, and I found that changing the uninstall path in the script may work.

First, I download a local copy of the uninstalling script

curl -O https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh

Then run the script locally and set the path to /user/local(which is the default path of homebrew on intel Mac)

/bin/bash uninstall.sh --path=/usr/local

but it completed with 2 warnings I'm not sure what they are

Warning: Failed during: /usr/bin/sudo rmdir /usr/local
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:
/usr/local/Cellar/
/usr/local/Frameworks/
/usr/local/Homebrew/
/usr/local/bin/
/usr/local/etc/
/usr/local/include/
/usr/local/lib/
/usr/local/opt/
/usr/local/sbin/
/usr/local/share/
/usr/local/texlive/
/usr/local/var/
You may wish to remove them yourself.

Either way, I delete those files manually.

(This is my first time to answer something on stack overflow. Hope this help!)

巷子口的你 2025-02-20 12:50:06

查看该uninstall.sh,有一个homebrew_prefix_default根据处理器类型设置的位置,并且有用法信息说:

-p, --path=PATH  Sets Homebrew prefix. Defaults to ${homebrew_prefix_default}.

因此,您肯定可以覆盖您可以覆盖通过- 路径= ...选项,默认位置与您想要的路径,即脚本将为Intel机器选择的路径,即/usr/local

Looking at that uninstall.sh, there's a spot where homebrew_prefix_default gets set according to the processor type, and there's usage info that says:

-p, --path=PATH  Sets Homebrew prefix. Defaults to ${homebrew_prefix_default}.

So it sure looks like you can override the default location by passing the --path=... option with the path that you want, namely the one that the script would've chosen for an Intel machine, i.e /usr/local.

半边脸i 2025-02-20 12:50:06

我遇到了同样的问题。
该解决方案只是为了从Mac中删除您的GIT配置。

命令:rm -rf〜/.gitConfig

执行命令后尝试安装brew。 )”

命令:/bin/bash -c'$(curl -fssl https://raw.githubusercontent.com/homebrew/install/install/head/head/install.sh
命令:brew install git然后配置您的github配置文件。

谢谢。

I faced the same problem.
The solution is just to remove your git configuration from your mac.

Command: rm -rf ~/.gitconfig

After executing the command try to install brew. Command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After installing homebrew install the brew git
command: brew install git then configure your GitHub profile.

Thank you.

闻呓 2025-02-20 12:50:06

一个简单简单的修复程序只需使用Arch -X86_64您的卸载命令的前面它应该可以正常工作。

A simple and easy fix for that would be just use arch -x86_64 infront of your uninstall command it should work fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文