Arm版的homebrew安装
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
安装脚本执行完成后,重启终端。(重启后才生效)。通过在终端输入”brew -v”,可以查看homebrew版本。如果正确输出版本信息,表示成功安装。
在M1芯片上,homebrew的安装路径为:”/opt/Homebrew/”
如需卸载,使用指令:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"
intel版的homebrew安装
arch -x86_64 /bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
为了区别Arm版和intel的homebrew
Open ~/.bash_profile
#将Arm版的命名为brew
export PATH="/opt/homebrew/bin:$PATH"
alias brew='/opt/homebrew/bin/brew'
#将intel版的命名为abrew
export PATH="/usr/local/bin:$PATH"
alias abrew='arch -x86_64 /usr/local/bin/brew'
#source一下
source ~/.bash_profile
更改为国内源
#Arm版的homebrew更改国内源
cd "$(brew --repo)"
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
#intel版的homebrew更改源
cd "$(abrew --repo)"
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
cd "$(abrew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
其他源可以参考该文章:https://blog.csdn.net/H_WeiC/article/details/107857302
替换homebrew-bottles(预编译二进制软件包)
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
source ~/.bash_profile
更新homebrew
brew update
abrew update
原创文章(本站视频密码:66668888),作者:xujunzju,如若转载,请注明出处:https://zyicu.cn/?p=5771
评论列表(2条)
低调炫富技术贴
@zjzb89:有么?😑