brew update

1.问题:在brew update 或 brew install(会自动先brew update)报问题如下

解决方法是进入/usr/local/Homebrew/Library/Taps/homebrew把homebrew-core这个文件夹删除

rm -rf homebrew-core

 

2.update时需要访问github,因为众所周知的原因无法访问github

进入 http://tool.chinaz.com/dns?type=1&host=www.github.com&ip= 把ip更新到/etc/hosts文件

hosts文件已经有xxx.xxx github.com直接修改。

 

3. 修改hosts后没有起到作用,仍无法访问github,在终端执行

sudo killall -HUP mDNSResponder

执行后可以在浏览器里进入github了。

 

4.执行brew update提示

解决方法是

git config --global --unset http.proxy
git config --global --unset https.proxy

执行后开始更新,发现之前删除的homebrew-core仍然需要下载,而且很大,下载挺慢的。

 

5. 过程中多次执行了

sudo killall -HUP mDNSResponder(之前还访问tool那个网站确保ip还是可以使用)

以及
git config --global --unset http.proxy
git config --global --unset https.proxy

 

6.最后虽然出现了Error,但仍然好像成功了

 

7. 执行install命令时还是先执行了update,但没有报Error

 

posted @ 2022-04-26 11:14  jason47  阅读(1838)  评论(0编辑  收藏  举报