前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >MacOS更换brew源

MacOS更换brew源

原创
作者头像
莫得急
发布2022-07-29 20:42:58
4.2K0
发布2022-07-29 20:42:58
举报
文章被收录于专栏:笔记集笔记集

如果在MacOS上用brew安装管理软件包,发现速度慢,可以更换brew源,方法如下:

1. 替换brew.git

代码语言:txt
复制
$ cd "$(brew --repo)"

# 中国科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

# 清华大学:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

2. 替换homebrew-core.git

代码语言:txt
复制
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

# 中国科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

# 清华大学:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

3. 替换homebrew-bottles

代码语言:txt
复制
# 中国科大:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

# 清华大学:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

4. 应用生效

代码语言:txt
复制
$ brew update

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. 替换brew.git
  • 2. 替换homebrew-core.git
  • 3. 替换homebrew-bottles
  • 4. 应用生效
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档