由于需要连接github
Cloning into homebrew-core很慢,从github克隆确实很慢,使用国内源手动克隆
创建Homebrew文件夹,并克隆(如果Homebrew目录里面有文件,则表示这里之前已经克隆成功,则跳过)
sudo mkdir /usr/local/Homebrew
sudo git clone https://mirrors.ustc.edu.cn/brew.git /usr/local/Homebrew
创建core文件夹 并 克隆(如果homebrew-core目录里面有文件,则表示这里之前已经克隆成功,则跳过)
sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
sudo git clone https://mirrors.ustc.edu.cn/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
获取权限 运行更新(两句话分开运行)
sudo chown -R $(whoami) /usr/local/Homebrew
brew update
替换安装源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
再次执行
brew install pyenv
速度很快