最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Win中VMWare的macOS安装brew报错:curl 7 Failed to connect to raw.githubusercontent.com port 443 Connection refused

raw crifan 382浏览 0评论
折腾:
【未解决】Win中VMWare中macOS虚拟机中安装homebrew
期间,先去参考之前帖子
【已解决】Mac中安装Python
先去给macOS安装brew,结果报错
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
结果报错:
crifanlideMac:~ crifanli$ /usr/bin/ruby -e "$(curl -fsSL  https://raw.githubusercontent.com/Homebrew/install/master/install)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
macos brew
The Missing Package Manager for macOS (or Linux) — Homebrew
是类似的:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
很明显会出现一样的问题的
crifanlideMac:~ crifanli$ /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 refused
macOS虚拟机中是可以打开
https://github.com
所以不是网络问题。
macos curl 7 Failed to connect to raw.githubusercontent.com port 443 Connection refused
Homebrew | curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused_静心 Study-CSDN博客_curl: (7) failed to connect to raw.githubuserconte
https://blog.csdn.net/u012400885/article/details/103849472
先去用浏览器打开
https://raw.githubusercontent.com/Homebrew/install/master/install
结果此处无法打开:
此处暂时不想要单独下载rb文件
还是想要彻底搞清楚怎么回事
关于Mac下载brew报curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
https://medium.com/@weixiao_6070/%E5%85%B3%E4%BA%8Emac%E4%B8%8B%E8%BD%BDbrew%E6%8A%A5curl-7-failed-to-connect-to-raw-githubusercontent-com-port-443-connection-refused-2293c50b7ff
安装homebrew报错curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation – 简书
https://www.jianshu.com/p/68efabd2e32b
然后发现:
【已解决】Windows中浏览器打开raw.githubusercontent.com报错: 错误代码 DNS_PROBE_POSSIBLE
然后再去macOS虚拟机中去试试:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
问题依旧。
那看来要去:
macOS中,加上hosts配置了。
mac hosts
Mac OS 下三种修改Hosts文件的方法 – 简书
直接 
sudo vi /etc/hosts
加上:
# github
151.101.76.133 raw.githubusercontent.com
即可
然后保存后退出
crifanlideMac:~ crifanli$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1    localhost
255.255.255.255 broadcasthost
::1             localhost
# github
151.101.76.133 raw.githubusercontent.com
确认没问题。
再去试试
即可继续安装。
【总结】
此处,macOS中
/usr/bin/ruby -e "$(curl -fsSL  https://raw.githubusercontent.com/Homebrew/install/master/install)"
但是报错:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
原因:
此处DNS被墙,导致无法访问raw.githubusercontent.com
解决办法:
找到raw.githubusercontent.com实际的IP,加到本地hosts配置中即可。
此处macOS中
vi /etc/hosts
再去加上:
# github
151.101.76.133 raw.githubusercontent.com
即可。
注:
关于寻找最新IP和如何刷新立刻生效,详见:
【已解决】Windows中浏览器打开raw.githubusercontent.com报错: 错误代码 DNS_PROBE_POSSIBLE

转载请注明:在路上 » 【已解决】Win中VMWare的macOS安装brew报错:curl 7 Failed to connect to raw.githubusercontent.com port 443 Connection refused

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.203 seconds, using 23.37MB memory