我正在尝试删除 Homebrew,以便可以将其安装在另一个帐户上。但在某个地方,我一定搞砸了。我遵循了常见问题解答中的卸载提示,我想我设法部分删除了它。现在,当我尝试 brew doctor 时,我得到:
-bash: brew: command not found
所以我认为它已部分卸载。但是当我运行 Homebrew 安装脚本时,我收到以下消息:
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
所以我尝试 rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup 并得到:
rm: /usr/local/.git/branches: Permission denied
rm: /usr/local/.git/config: Permission denied
rm: /usr/local/.git/description: Permission denied
rm: /usr/local/.git/FETCH_HEAD: Permission denied
rm: /usr/local/.git/HEAD: Permission denied
rm: /usr/local/.git/hooks/applypatch-msg.sample: Permission denied
rm: /usr/local/.git/hooks/commit-msg.sample: Permission denied
rm: /usr/local/.git/hooks/post-update.sample: Permission denied
rm: /usr/local/.git/hooks/pre-applypatch.sample: Permission denied
rm: /usr/local/.git/hooks/pre-commit.sample: Permission denied
rm: /usr/local/.git/hooks/pre-rebase.sample: Permission denied
rm: /usr/local/.git/hooks/prepare-commit-msg.sample: Permission denied
rm: /usr/local/.git/hooks/update.sample: Permission denied
rm: /usr/local/.git/hooks: Permission denied
rm: /usr/local/.git/info/exclude: Permission denied
rm: /usr/local/.git/info: Permission denied
rm: /usr/local/.git/logs/refs/remotes/origin/master: Permission denied
rm: /usr/local/.git/logs/refs/remotes/origin: Permission denied
rm: /usr/local/.git/logs/refs/remotes: Permission denied
rm: /usr/local/.git/logs/refs: Permission denied
rm: /usr/local/.git/logs: Permission denied
rm: /usr/local/.git/objects/info: Permission denied
rm: /usr/local/.git/objects/pack/pack-f61919e44996693539de9ee7986ee3c78a0b7c2a.idx: Permission denied
rm: /usr/local/.git/objects/pack/pack-f61919e44996693539de9ee7986ee3c78a0b7c2a.pack: Permission denied
rm: /usr/local/.git/objects/pack: Permission denied
rm: /usr/local/.git/objects: Permission denied
rm: /usr/local/.git/refs/heads: Permission denied
rm: /usr/local/.git/refs/remotes/origin/master: Permission denied
rm: /usr/local/.git/refs/remotes/origin: Permission denied
rm: /usr/local/.git/refs/remotes: Permission denied
rm: /usr/local/.git/refs/tags: Permission denied
rm: /usr/local/.git/refs: Permission denied
rm: /usr/local/.git: Directory not empty
现在我不知道该怎么做,所以我可以重新安装它。我对终端命令不太熟悉,所以可能是我遗漏了一些简单的东西,但请提出建议。