mac 安装homebrew
问题:macOS安装Homebrew时总是报错(Failed to connect to raw.githubusercontent.com port 443: Connection refused)
原因:由于某些你懂的因素,导致GitHub的raw.githubusercontent.com域名解析被污染了。
解决办法:通过修改hosts解决此问题。
查询真实IP
在https://www.ipaddress.com/查询raw.githubusercontent.com的真实IP。
修改hosts
1 | sudo vim /etc/hosts |
添加如下内容:
1 | 199.232.28.133 raw.githubusercontent.com |
可以使用国内源啦
1 | /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" |