记录curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused解决方案

简介: 关于这个错误其实遇到过好多次了,基本都是在每次换电脑之后执行

关于这个错误其实遇到过好多次了,基本都是在每次换电脑之后执行

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"


命令的时候,原因是raw.githubusercontent.com 这个域名被那个啥了,我们需要找到这个域名的IP地址,然后把他添加到本地hosts文件中就可以了!


  1. 打开网站https://www.ipaddress.com/,查询一下raw.githubusercontent.com对应的IP地址


image.png

image.png

将raw.githubusercontent.com域名的IP地址199.232.96.133(第一步中查询的IP地址)添加到系统的hosts文件中(文件路径/etc)


image.png


image.png


不过这里要注意,这里你直接更改hosts,会告诉你没有权限。我们可以复制一份hosts到桌面,然后将199.232.96.133      raw.githubusercontent.com这行添加到桌面的hosts文件中


image.png

image.png

然后再将这个hosts文件移动到/etc文件夹下,选择替换文件,这时会弹出“访达”想要移动“hosts”的提示,输入电脑密码允许即可!


image.png


  1. 最后,我们再回到终端执行


/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"


命令就可以了。




相关文章
|
5月前
|
Shell 开发工具 git
git拉去代码报错"Failed to connect to 127.0.0.1 port 31181: Connection refused"
在克隆`https://example.git/`时遇到错误:"fatal: unable to access 'https://example.git/': Failed to connect to 127.0.0.1 port 31181: Connection refused"。原因是Windows上代理设置未正确关闭,影响了Git配置。解决方法是通过git bash运行命令检查并取消代理:`git config --global http.proxy`和`git config --global --unset http.proxy`。
161 1
 git拉去代码报错"Failed to connect to 127.0.0.1 port 31181: Connection refused"
|
6月前
|
Go 开发工具 git
【git】解决:Failed to connect to 127.0.0.1 port 7890: Connection refused
【git】解决:Failed to connect to 127.0.0.1 port 7890: Connection refused
1926 0
|
5月前
|
Linux 数据安全/隐私保护
Could not connect to ‘121.37.92.110‘ (port 22): Connection failed.
Could not connect to ‘121.37.92.110‘ (port 22): Connection failed.
|
5月前
|
Ubuntu Linux C语言
Could not establish connection to “xx.xx.xx.xx“:The VS Code Server faild to start.【重要解决方案】
Could not establish connection to “xx.xx.xx.xx“:The VS Code Server faild to start.【重要解决方案】
161 0
|
网络协议
解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443 ...
解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443 ...
2248 1
mac安装homebrew失败:Failed to connect to raw.githubusercontent.com port 443: Connection refused
mac安装homebrew失败:Failed to connect to raw.githubusercontent.com port 443: Connection refused
|
网络安全
错误集--NFS报错clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
错误集--NFS报错clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
1542 0
错误集--NFS报错clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
|
Java 网络安全 Docker
curl: (56) Recv failure: Connection reset by peer
curl: (56) Recv failure: Connection reset by peer
799 0
|
Kubernetes 网络协议 容器
kubectl命令报错:Unable to connect to the server: dial tcp XXX:16443: connect: no route to host
kubectl命令报错:Unable to connect to the server: dial tcp XXX:16443: connect: no route to host
996 0
|
Android开发
Error connecting to the service protocol failed to connect to错误
Error connecting to the service protocol failed to connect to错误