【2020.04.21】MacOS10.15.4+Brew一键安装sh+阿里云Repo MacOS

Cool.Cat 2020-04-21 2952

1、国内安装地址

/usr/bin/ruby -e "$(curl -fsSL https://gitee.com/csmodx/HomeBrew/raw/master/brew.sh)"


2、替换为阿里云repo

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

# 应用生效
brew update

# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc


3、恢复官方repo

# 重置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

#删除zshrc里对应的HOMEBREW_BOTTLE_DOMAIN内容


4、查看阿里云Repo是否设置成功

cool.cat@coolcatdeiMac homebrew-core % brew config
HOMEBREW_VERSION: 2.2.13
ORIGIN: https://mirrors.aliyun.com/homebrew/brew.git
HEAD: 3d9cf83fec45a75af61551f53d25383abe009d31
Last commit: 8 days ago
Core tap ORIGIN: https://mirrors.aliyun.com/homebrew/homebrew-core.git
Core tap HEAD: 2fe1503805753121be8767d9a6889ce84bc09fed
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.aliyun.com/homebrew/homebrew-bottles
HOMEBREW_MAKE_JOBS: 6
CPU: hexa-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1103
Git: 2.24.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.4-x86_64
CLT: 11.4.1.0.1.1586360307
Xcode: 11.4.1


最新回复 (0)
返回
发新帖
X