因为一直卸载不了,主要是一些网址访问不稳定,所以直接用暴力卸载方法
1、暴力卸载
sudo rm -rf /usr/local/.git
rm -rf ~/Library/Caches/Homebrew
rm -rf /usr/local/Homebrew
2、从新安装
从新安装也遇到了一些问题还是地址打不开这类的,我用的这个网址的方法,瞬间ok了
先把host文件加上这些映射
# GitHub Start
52.74.223.119 github.com
52.74.223.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
199.232.96.133 raw.githubusercontent.com
199.232.96.133 gist.githubusercontent.com
199.232.96.133 cloud.githubusercontent.com
199.232.96.133 camo.githubusercontent.com
199.232.96.133 avatars0.githubusercontent.com
199.232.96.133 avatars1.githubusercontent.com
199.232.96.133 avatars2.githubusercontent.com
199.232.96.133 avatars3.githubusercontent.com
199.232.96.133 avatars4.githubusercontent.com
199.232.96.133 avatars5.githubusercontent.com
199.232.96.133 avatars6.githubusercontent.com
199.232.96.133 avatars7.githubusercontent.com
199.232.96.133 avatars8.githubusercontent.com
199.232.96.133 user-images.githubusercontent.com
185.199.109.154 github.githubassets.com
# GitHub End
然后运行命令
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
就可以了
参考文章如下
mac下镜像飞速安装Homebrew教程 - 知乎
解决GitHub网页githubusercontent地址无法访问问题 - 知乎
mac上homebrew重装手记 - 菩提树下的杨过 - 博客园