gpt4 book ai didi

homebrew - 如何卸载 Homebrew 软件?

转载 作者:行者123 更新时间:2023-12-04 03:57:24 34 4
gpt4 key购买 nike

我今天在不知道自己在做什么的情况下安装了 Homebrew 软件,现在我的 scikit-learn 包坏了。我想通过卸载 Homebrew 软件来撤消我所做的一切,并尝试按照此处的提示操作:
https://github.com/Homebrew/homebrew/wiki/FAQ

但是,我认为 homebrew 安装到/usr/bin/local,而不是/usr/bin/,所以我不确定我可以使用链接中的说明。

当我最初安装 Homebrew 软件 ( ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" ) 时,我收到以下消息:

==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/lib/pkgconfig
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7

我可以删除里面的文件吗
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

我害怕在卸载过程中搞砸一些事情。
顺便说一句,卸载 Homebrew 软件甚至会将​​我的系统恢复到以前的状态吗?我该怎么做呢?

最佳答案

这包含在 Homebrew 软件常见问题解答中:

https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md#how-do-i-uninstall-homebrew

它指定了一个您可以运行的脚本来完成它。您应该运行该脚本。截至目前,该脚本内容如下:

#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!

function abort {
echo "$1"
exit 1
}

set -e

/usr/bin/which -s git || abort "brew install git first!"
test -d /usr/local/.git || abort "brew update first!"

cd `brew --prefix`
git checkout master
git ls-files -z | pbcopy
rm -rf Cellar
bin/brew prune
pbpaste | xargs -0 rm
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
test -d Library/LinkedKegs && rm -r Library/LinkedKegs
rmdir -p bin Library share/man/man1 2> /dev/null
rm -rf .git
rm -rf ~/Library/Caches/Homebrew
rm -rf ~/Library/Logs/Homebrew
rm -rf /Library/Caches/Homebrew

关于homebrew - 如何卸载 Homebrew 软件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23251665/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com