您当前的位置: 首页 >  彭世瑜

Homebrew镜像修改

彭世瑜 发布时间:2019-03-24 23:43:34 ,浏览量:2

使用brew命令安装软件的时候总是会出现卡住的情况

Updating Homebrew...

关闭brew每次执行命令时的自动更新

vim ~/.bash_profile

# 新增一行
export HOMEBREW_NO_AUTO_UPDATE=true

替换国内源就可以变快了

1、中科大源

# 替换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

2、清华源

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.git:
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

# 重置homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git

服务器地址源

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

参考:

  1. https://lug.ustc.edu.cn/wiki/mirrors/help/brew.git
  2. https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
  3. homebrew的安装和使用
关注
打赏
1688896170
查看更多评论

彭世瑜

暂无认证

  • 2浏览

    0关注

    2727博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0578s