赞
踩
git -C "$(brew --repo)" remote -v
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
// 更新
brew update
中科大镜像站
// 替换 Homebrew
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
// 替换 Homebrew Core
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
// 替换 Homebrew Cask
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
# 更新
brew update
还原
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
brew update
清华
# 对于 bash 用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
# 对于 zsh 用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
中科大
# 对于 bash 用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
# 对于 zsh 用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
还原
1. 注释掉bash配置文件里的有关Homebrew Bottles
即可恢复官方源
2. 重启bash或让bash重读配置文件。
#查看版本
brew -v
#查询软件
brew search 软件名
#安装软件
brew install 软件名
#后台运行的软件(重启之后可以自动启动)
brew services start|stop|restart 软件名
#卸载软件
brew uninstall 软件名
#查看包信息
brew info [包名]
#查看安装了哪些软件
brew list 软件名
# 检查brew能否正常工作
brew doctor
# 更新brew包
brew update
# 查询可更新的包
brew outdated
# 更新所有[指定包]
brew upgrade [包名]
# 清理旧版本
//清理所有包的旧版本
brew cleanup
//清理指定包的旧版本
brew cleanup [包名]
//查看可清理的旧版本包,不执行实际操作
brew cleanup -n
# 锁定不想更新的包
//锁定某个包
brew pin $FORMULA
//取消锁定
brew unpin $FORMULA
#查看帮助
brew help
# 在浏览器端打开 Homebrew 官网
brew home
# 显示包的依赖信息
brew deps [包名]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。