安装方式一(推荐):(使用 科大源 进行安装)
安装
$ /bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
卸载
$ /bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/uninstall.sh)"
- 如果报错 Error: No similarly named formulae found.,则更换一下 homebrew-core 文件即可,如果 git clone 的方式慢,也可以直接打开链接进行下载,将下载的文件夹改成 homebrew-core 替换掉之前的 homebrew-core 文件即可。
$ cd /usr/local/Homebrew/Library/Taps/homebrew/
$ rm -rf homebrew-core
$ git clone https://github.com/Homebrew/homebrew-core.git
安装方式二:(完全纯官方安装,但是需要配置 host,githubusercontent 国内访问不了)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
安装报错这个,试试连接梯子:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection reset by peer
卸载
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
卸载过程中根据提示进行操作
aaMacBook-Pro: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Warning: This script will remove:
/Users/dengzemiao/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]
......
参考:https://zhuanlan.zhihu.com/p/111014448