赞
踩
目录
5.安装Homebrew时遇到ERROR fatal: unable to access ‘https://github.com/Homebrew/brew/’
可以参考:深入分析GitHub不能访问的原因及解决方案_笔记大全_设计学院
1、获取github.com的ip
方法一:
直接在终端输入命令
ping github.com
效果如下:
方法二:
效果如下:
2、修改hosts文件,文件位置 /etc/hosts ;
在电脑的hosts文最后一行加上
20.205.243.166 github.com
备注:如果无法修改,可能是文件没有写入权限,依次执行下面的命令后再加上,最后记得保存退出. (:wq)
- cd /etc
-
- sudo chmod 777 hosts
-
- vi hosts
貌似还存在代码上传下载速度慢的问题~
103.228.130.27 http://github.global.ssl.fastly.net
- fatal: unable to access 'https://github.com/Homebrew/brew/': Recv failure: Operation timed out
- Failed during: /usr/bin/git fetch --force --tags origin
可以执行下面命令
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
即可解决
brew install git
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。