解决macos 安装homebrew速度慢(转)

问题描述

安装的homebrew的时候下载速度超级慢,解决办法是更换homebrew的下载源

操作步骤

1.用safari打开“https://raw.githubusercontent.com/Homebrew/install/master/install.sh”,把里面的文本复制下来,在桌面创建文本文件“brew_install”,粘贴.

2.搜索:

BREW_REPO="https://github.com/Homebrew/brew"

替换成:

BREW_REPO="https://mirrors.ustc.edu.cn/brew.git"

保存.

3.打开terminal,运行命令:/bin/bash + 刚才的brew_install文件,比如:

/bin/bash /Users/admin/Desktop/brew_install
 


.把homebrew repo切换为清华镜像

cd "$(brew --repo)"

git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

brew update

PS:如果有报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused,可以通过这个命令解决:sudo gem install redis



作者:小八子的开发之路
链接:https://www.jianshu.com/p/fdf7e316f096
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
原文地址:https://www.cnblogs.com/zl1991/p/13843202.html