Open lilunze opened 6 years ago
homebrew原始镜像源速度感人,通过下面方法更换国内镜像源
替换brew.git:
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/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
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
替换homebrew-bottles:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile $ source ~/.bash_profile
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile $ source ~/.bash_profile
应用生效:
$ brew update
如果因为某些原因想要换回原始镜像源也是ok的:
重置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
删除环境变量
/.bash_profile
homebrew原始镜像源速度感人,通过下面方法更换国内镜像源
替换brew.git:
中国科大:
清华大学:
替换homebrew-core.git:
中国科大:
清华大学:
替换homebrew-bottles:
中国科大:
清华大学:
应用生效:
如果因为某些原因想要换回原始镜像源也是ok的:
重置brew.git:
重置homebrew-core.git:
删除环境变量