惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
T
Threatpost
L
LangChain Blog
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
W
WeLiveSecurity
T
The Blog of Author Tim Ferriss
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hacker News: Front Page
P
Privacy International News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Attack and Defense Labs
Attack and Defense Labs
The Hacker News
The Hacker News
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The Register - Security
The Register - Security
Cisco Talos Blog
Cisco Talos Blog
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
H
Help Net Security
U
Unit 42
S
Security Affairs
Engineering at Meta
Engineering at Meta
Forbes - Security
Forbes - Security
The Cloudflare Blog
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Webroot Blog
Webroot Blog
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Help Net Security
Help Net Security
Latest news
Latest news
SecWiki News
SecWiki News
H
Heimdal Security Blog
IT之家
IT之家
博客园 - Franky
Google DeepMind News
Google DeepMind News
小众软件
小众软件
A
Arctic Wolf
月光博客
月光博客
T
Tailwind CSS Blog
NISL@THU
NISL@THU
GbyAI
GbyAI
N
News and Events Feed by Topic

博客园 - Mr.peter

Git 全量终极速记表 git常用命令汇总 Golang基础面试题 ansible是什么?怎么玩?给出常问的面试题和答案 Terraform telnet localhost 3306 -bash: telnet: command not found macos 开放3306端口 Mysql 授予root在任意主机访问数据库的权限 使用Redis来处理高并发问题 go slice切片的扩容机制是什么? 使用Kubernetes时可以采取哪些最佳安全措施 Kubernetes与Docker Swarm的区别如何 k8s是怎么进行服务注册的 说说你对Job这种资源对象的了解 常用的标签分类有哪些 简述Helm及其优势 简述Kubernetes集群联邦 简述Kubernetes中,如何使用EFK实现日志的统一管理 Kubernetes 网络 Kubernetes PodSecurityPolicy
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused Error: git: Failed to download resource "git.rb"
Mr.peter · 2025-08-11 · via 博客园 - Mr.peter

这个问题是由于无法连接到 GitHub 的 raw.githubusercontent.com 域名导致的 Homebrew 安装失败。以下是几种解决方案:

1. ‌修改 Hosts 文件‌
查询 raw.githubusercontent.com 的最新 IP 地址(例如通过 IPAddress.com)
编辑 Hosts 文件:
bash
sudo vim /etc/hosts

添加以下内容(IP 可能会变,请确认最新):
text
185.199.108.133 raw.githubusercontent.com

保存后重试安装。
2. ‌使用国内镜像安装 Homebrew‌
直接运行国内镜像脚本:
bash
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

选择中科大或清华镜像源加速安装。
3. ‌手动下载安装脚本‌
浏览器访问 https://raw.githubusercontent.com/Homebrew/install/master/install.sh,保存为本地文件(如 brew_install.sh)
修改脚本中的仓库地址为国内镜像(如替换 BREW_REPO 为 git://mirrors.ustc.edu.cn/brew.git)
执行脚本:
bash
chmod +x brew_install.sh
./brew_install.sh
```:ml-citation{ref="2,5" data="citationList"}

4. ‌检查网络代理‌
如果使用代理,确保代理配置正确或临时关闭代理
尝试切换网络(如手机热点)
5. ‌安装 Git 的替代方法‌

如果仅需安装 Git,可暂时绕过 Homebrew:

从 Git 官网 直接下载安装包
或使用 MacPorts:
bash
sudo port install git
```:ml-citation{ref="8,12" data="citationList"}

注意事项
修改 Hosts 后需刷新 DNS 缓存:sudo dscacheutil -flushcache
安装完成后建议运行 brew doctor 检查环境