记录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)"


命令就可以了。




相关文章
|
4月前
|
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
550 0
|
19天前
|
分布式计算 Hadoop 网络安全
[m1pro ] ssh: connect to host localhost port 22: Connection refused
[m1pro ] ssh: connect to host localhost port 22: Connection refused
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
|
9月前
|
网络协议
解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443 ...
解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443 ...
179 1
|
6月前
|
Java 网络安全 Docker
curl: (56) Recv failure: Connection reset by peer
curl: (56) Recv failure: Connection reset by peer
341 0
|
7月前
|
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
345 0
|
9月前
|
网络协议 Linux 网络安全
使用frp时遇到的问题connect: connection refuseddial tcp xxxx:7000: connect: connection refused
最近在做的项目需要用到frp来做代理连接本地内网机,卡在最后启动客户端的时候,提示报错:login to server failed: dial tcp xxxx:7000: connect: connection refuseddial tcp xxxx:7000: connect: connection refused!!找了很多尝试的办法,现在给大家列一下希望对大家有帮助。
1637 0
|
Java 应用服务中间件 PHP
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
379 0
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
|
网络安全
错误集--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)
1189 0
错误集--NFS报错clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)