• brew换源和恢复


    替换为国内源

    # 查看 brew.git 当前源
    $ cd "$(brew --repo)" && git remote -v
    origin https://github.com/Homebrew/brew.git (fetch)
    origin https://github.com/Homebrew/brew.git (push)

    # 查看 homebrew-core.git 当前源
    $ cd "$(brew --repo homebrew/core)" && git remote -v
    origin https://github.com/Homebrew/homebrew-core.git (fetch)
    origin https://github.com/Homebrew/homebrew-core.git (push)

    # 替换为中科大源
    $ git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    $ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
    $ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

    # zsh 替换 brew bintray 镜像
    $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
    $ source ~/.zshrc

    # bash 替换 brew bintray 镜像
    $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
    $ source ~/.bash_profile

    # 刷新源
    $ brew update

    替换为默认源

    # 重置 brew.git 为官方源
    $ git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

    # 重置 homebrew-core.git 为官方源
    $ git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git

    # 重置 homebrew-cask.git 为官方源
    $ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask

    # zsh 注释掉 HOMEBREW_BOTTLE_DOMAIN 配置
    $ vi ~/.zshrc
    # export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles

    # bash 注释掉 HOMEBREW_BOTTLE_DOMAIN 配置
    $ vi ~/.bash_profile
    # export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles

    # 刷新源
    $ brew update


    原文链接:https://blog.csdn.net/pluckypan/article/details/120810854

  • 相关阅读:
    hdu 1863 畅通工程
    poj 2524 Ubiquitous Religions
    04 Linux终端命令01
    05 linux中yum源报错
    Filterg过滤器和Listener监听器
    03 Centos的文件目录、远程连接工具及快照操作
    02 安装虚拟机以及设置虚拟机网卡信息
    01VM虚拟机介绍及配置虚拟机网卡信息
    Jstl表达式
    EL表达式
  • 原文地址:https://www.cnblogs.com/xingnie/p/16276563.html
Copyright © 2020-2023  润新知