内容简介:今天发现在用 brew 安装一个软件的时候非常非常慢,半天没反应,怀疑因为软件源在外国受墙的影响。于是看了一下当前使用的是哪个源:可以看到,其实 brew 的仓库本质上就是一个 git 仓库。
今天发现在用 brew 安装一个软件的时候非常非常慢,半天没反应,怀疑因为软件源在外国受墙的影响。
于是看了一下当前使用的是哪个源:
# 进入 brew 的仓库根目录 TMBP:~ tony$ cd "$(brew --repo)" # 查看仓库地址 TMBP:Homebrew tony$ git remote -v origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (fetch) origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (push)
可以看到,其实 brew 的仓库本质上就是一个 git 仓库。
打开 https://mirrors.tuna.tsinghua... 地址一看,发现不见了...
原来不是墙的干扰(一般情况下 GitHub 不会被墙,顶多也就慢一点)。
回到清华大学开源软件镜像站首页搜了一下,发现地址没错,确实是 https://mirrors.tuna.tsinghua...
这就有点尴尬了,清华坑人啦~
于是网上找了个中科大的源 https://mirrors.ustc.edu.cn/b...
看起来不错~
改成中科大的源:
# 进入 brew 的仓库根目录 cd "$(brew --repo)" # 修改为中科大的源 git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
同理,修改 homebrew-cask、homebrew-core、homebrew-services 的远程仓库地址
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
修改完仓库地址后,更新一下,加上 -v 参数可以看到当前跑的进度:
brew update -v
改完之后,果然快的一米!
以上所述就是小编给大家介绍的《HomeBrew 修改镜像源解决慢的问题》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Building Websites with Joomla!
H Graf / Packt Publishing / 2006-01-20 / USD 44.99
This book is a fast paced tutorial to creating a website using Joomla!. If you've never used Joomla!, or even any web content management system before, then this book will walk you through each step i......一起来看看 《Building Websites with Joomla!》 这本书的介绍吧!