Mac下软件管理工具brew更换国内源及常用命令

更换国内源:官方链接

cd "$(brew --repo)"
 
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
 
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
 
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
 
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile'

source ~/.bash_profile

安装多个版本软件,例如php

brew install [email protected]
brew install php   // 默认安装php8
brew link --overwrite [email protected] //切换版本

查找软件

brew update
brew search xxx

查看软件安装情况

brew info xxx

你可能感兴趣的:(Mac下软件管理工具brew更换国内源及常用命令)