如何卸载自制软件?

时间:2014-04-23 17:48:41

标签: homebrew

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

但是,我认为自制软件安装在/ usr / bin / local,而不是/ usr / bin /,所以我不确定我是否可以使用链接中的说明。

当我最初安装自制软件(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

我害怕在卸载过程中搞砸了什么。 顺便说一下,卸载自制程序甚至可以将我的系统恢复到以前的状态吗?我该怎么做呢?

5 个答案:

答案 0 :(得分:3)

自制常见问题解答中包含这一点:

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

答案 1 :(得分:2)

我已经编写了一个专门用于卸载Homebrew的脚本,在我看来,它是目前最好的工具。你可以在这里找到它:

https://gist.github.com/SteveBenner/11254428

答案 2 :(得分:0)

这对我有用

官方酿造uninstalling步骤:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

但是/usr/bin/ruby只是符号链接,您需要输入

才能找到红宝石
which ruby

哪个会给你/snap/bin/ruby

所以就用这个吧:

/snap/bin/ruby  -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

答案 3 :(得分:0)

在cli中运行此命令

Number

答案 4 :(得分:0)

只需在终端中运行此代码:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"