标签:core 镜像 git 更新 homebrew brew Homebrew
Homebrew官方的源一般下载包之类的会很慢,所以通常我们都是用国内的镜像源来代替,这样会提高我们的效率。Homebrew主要有四个部分组成: brew、homebrew-core 、homebrew-bottles、homebrew-cask。
名称 说明
brew Homebrew 源代码仓库
homebrew-core Homebrew 核心软件仓库
homebrew-bottles Homebrew 预编译二进制软件包
homebrew-cask MacOS 客户端应用
Homebrew国内镜像源目前主要有中科大镜像、阿里镜像、清华镜像。
首先查看自己本地的镜像源地址是什么,在命令行输入以下命令可以查询:
查看 brew.git 当前源
cd "$(brew --repo)" && git remote -v
查看 homebrew-core.git 当前源
cd "$(brew --repo homebrew/core)" && git remote -v
如果输出是下面这些,就代表不是本地镜像源,可以换成本地镜像源,这样下载会更快点。
查看 brew.git 当前源输出
origin https://github.com/Homebrew/brew.git (fetch)
origin https://github.com/Homebrew/brew.git (push)
查看 homebrew-core.git 当前源输出
origin https://github.com/Homebrew/homebrew-core.git (fetch)
origin https://github.com/Homebrew/homebrew-core.git (push)
一、切换 Homebrew 镜像源为中科大镜像源
替换brew.git:
cd "$(brew --repo)" && git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
替换homebrew-cask.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" && git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
zsh 替换homebrew-bottles镜像,Mac OS在10.15系统开始,默认的shell都换成了zsh
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
修改使其立即生效
source ~/.zshrc
bash 替换homebrew-bottles镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
修改使其立即生效
source ~/.bash_profile
刷新源
brew update
标签:core,镜像,git,更新,homebrew,brew,Homebrew 来源: https://www.cnblogs.com/guodoudou/p/15907362.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。