美文网首页
切换 homebrew 下载源

切换 homebrew 下载源

作者: 只想做个俗人_贪财_好色 | 来源:发表于2022-08-25 13:21 被阅读0次

    设置阿里下载源

    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
    
    brew update
    
    #设置环境变量  以zsh为例
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
    source ~/.zshrc
    

    恢复下载源

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

    需要把 ~/.zshrc 中的 HOMEBREW_BOTTLE_DOMAIN 环境变量删除
    执行

    source ~/.zshrc
    

    相关文章

      网友评论

          本文标题:切换 homebrew 下载源

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