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


命令就可以了。




相关文章
成功解决.ReadTimeoutError: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn‘, port=443): Read timed o
成功解决.ReadTimeoutError: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn‘, port=443): Read timed o
|
2月前
|
应用服务中间件 nginx Docker
connect() failed (113: No route to host) while connecting to upstream
connect() failed (113: No route to host) while connecting to upstream
85 0
|
3月前
|
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`。
74 1
 git拉去代码报错"Failed to connect to 127.0.0.1 port 31181: Connection refused"
|
3月前
|
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.
|
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
1491 0
|
网络协议
解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443 ...
解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443 ...
1837 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
|
Java 应用服务中间件 PHP
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
536 0
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
|
10月前
|
Java 网络安全 Docker
curl: (56) Recv failure: Connection reset by peer
curl: (56) Recv failure: Connection reset by peer
582 0
|
11月前
|
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
811 0