当前位置:网站首页>Brew source change

Brew source change

2022-06-11 03:41:00 PostTruth

Brew Source change

brief introduction

Homebrew Is a free and open source software package management system , To simplify macOS and linux The software installation process on the system . It has an installation 、 uninstall 、 to update 、 see 、 Search and many other practical functions , With a simple command , Package management can be realized , It's very convenient .

Homebrew There are mainly four parts : brew、homebrew-core 、homebrew-bottles、homebrew-cask.

name explain
brew Homebrew Source code warehouse
homebrew-core Homebrew Core software warehouse
homebrew-bottles Homebrew Pre compiled binary packages
homebrew-cask Provide macOS Applications and large binary files

Replace with aliyuan

#  see  brew.git  Current source 
$ cd "$(brew --repo)" && git remote -v
origin	https://github.com/Homebrew/brew.git (fetch)
origin	https://github.com/Homebrew/brew.git (push)

#  see  homebrew-core.git  Current source 
$ 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)

#  modify  brew.git  For aliyuan 
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

#  modify  homebrew-core.git  For aliyuan 
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

# zsh  Replace  brew bintray  Mirror image 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

# bash  Replace  brew bintray  Mirror image 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

#  Refresh source 
$ brew update

Replace with Tsinghua source

#  Replace each source 
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

# zsh  Replace  brew bintray  Mirror image 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

# bash  Replace  brew bintray  Mirror image 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

#  Refresh source 
$ brew update

Replace with the source of China Science and Technology University

#  Replace each source 
$ 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  Replace  brew bintray  Mirror image 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

# bash  Replace  brew bintray  Mirror image 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

#  Refresh source 
$ brew update

Reset to official source

#  Reset  brew.git  Official source 
$ git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

#  Reset  homebrew-core.git  Official source 
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git

#  Reset  homebrew-cask.git  Official source 
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask

# zsh  Comment out  HOMEBREW_BOTTLE_DOMAIN  To configure 
$ vi ~/.zshrc
# export HOMEBREW_BOTTLE_DOMAIN=xxxxxxxxx

# bash  Comment out  HOMEBREW_BOTTLE_DOMAIN  To configure 
$ vi ~/.bash_profile
# export HOMEBREW_BOTTLE_DOMAIN=xxxxxxxxx

#  Refresh source 
$ brew update
原网站

版权声明
本文为[PostTruth]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020553546382.html