zoukankan      html  css  js  c++  java
  • brew 替换国内镜像

    问题

    在使用brew install的时候, 经常会卡在Updating Homebrew...

    这是因为国内访问国外地址很慢的原因, 虽然可以使用ctrl+c来跳过, 但总想着能不能替换国内源呢?

    解决

    运行以下命令替换brew的 git 源:

    git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
    
    git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
    
    git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
    
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
    
    source ~/.bash_profile
    
    # 更新源之后, 重置本地 git HEAD
    brew update-reset
    

    OK, 现在已经替换完成了, 快体验一下这久违速度吧

    使用清华源, 地址:

    https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

  • 相关阅读:
    bzoj1797
    bzoj1266
    bzoj1497
    bzoj1412
    bzoj3156
    JSOI2014第三轮总结
    bzoj1855
    bzoj1044
    codeforces 371D
    codeforces 371B
  • 原文地址:https://www.cnblogs.com/hujingnb/p/14800240.html
Copyright © 2011-2022 走看看