Homebrew替换源

说明:原文(https://www.jianshu.com/p/6ea6e19c060d)

这个问题困扰了我很久,在网上找了很多资料。都是断章取义。没介绍完整,
都没有实际效果;最近需要在本地安装mysql。 为了安装快一点,
又重新面对brew install 慢的问题。又在网上把之前看的重新试一下。
终于解决了。下面的步骤,都是在本机上执行成功。brew install 慢的问题已经解决。
希望可以帮读者


步骤

切换到 Homebrew 目录

cd "$(brew --repo)"
查看远程仓库 git remote -v.  默认的使用的github。
 删除远程: git remote rm origin 
添加阿里源 :git remote add origin https://mirrors.aliyun.com/homebrew/brew.git
切换成阿里源: git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

替换 homebrew-core.git:

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
查看远程仓库 git remote -v.  默认的使用的github。
 删除远程: git remote rm origin 
添加阿里源 :git remote add origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
切换成阿里源: git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

替换 homebrew-bottles: 二进制文件

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile


替换 homebrew-cask.git: cask 表示 GUI 应用的源, 阿里云没有提供 cask 源, 故使用 USTC 源

cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote rm origin 
git remite add origin https://mirrors.ustc.edu.cn/homebrew-cask.git
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

作者:IT 入门指南

链接:https://www.jianshu.com/p/6ea6e19c060d

来源:简书

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

posted @ 2022-08-26 21:33  笑等茶凉  阅读(212)  评论(0编辑  收藏  举报