美文网首页
brew切换国内镜像

brew切换国内镜像

作者: 蚂蚁窝大梦想 | 来源:发表于2020-03-04 15:01 被阅读0次

    中科大镜像

    # 替换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
    
    # 应用生效
    brew update
    # 替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
    source ~/.zshrc
    

    切回官方

    # 替换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
    
    # 替换homebrew-cask.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
    git remote set-url origin https://github.com/Homebrew/homebrew-cask.git
    
    # 应用生效
    brew update
    
    # 删除.zshrc变量
    vim  ~/.zshrc
    # 删除如下变量
    # export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
    
    # 执行更新
    source ~/.zshrc
    
    

    相关文章

      网友评论

          本文标题:brew切换国内镜像

          本文链接:https://www.haomeiwen.com/subject/czivlhtx.html