brew安装
1、替换源/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2、安装软其他软件出现报错
Installing mysql dependency: icu4c
fatal: not in a git directory
3、解决方法
点击查看代码
#清华镜像源
git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
#中科大镜像源
git remote set-url origin http://mirrors.ustc.edu.cn/homebrew.git
#Coding源
git remote set-url origin https://git.coding.net/homebrew/homebrew.git
#三者选其一即可更新
git init
git remote add origin http://mirrors.ustc.edu.cn/homebrew.git
编辑/.bashrc或/.zshrc添加
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
按照如下即可修复
brew -v
4、brew版本问题Monterey
#!/bin/bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#更新Homebrew
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
#更新Homebrew-core
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
#更新Homebrew-cask(最重要的一步,很多更新完国内源依然卡就是没更新这个)
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/' >> ~/.zshrc
source ~/.zshrc
brew update-reset