更改 homebrew 镜像源

2018-10-29  本文已影响0人  _oenday

Mac 下的包安装管理工具:homebrew

vim ~/.bash_profile
echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
source ~/.bash_profile # 使刚才的配置立即生效
brew -v
brew update --verbose #观察update过程
brew info demo #查看demo包的信息
Brew tap xxx 添加源
brew update     #更新自己的Homebrew
brew search demo #寻找包名含有demo的包
brew doctor #检查brew的运行状态
brew outdates #检查本机内已经处于旧版本的包
brew list #列出brew安装的包
brew cleanup #清理缓存
brew install demo #安装demo包
brew uninstall demo #卸载demo包
brew link demo #关联demo包
php -m | grep phalcon  #检测扩展
brew -S phalcon   #找到对应版本的phalcon扩展
#修改homebrew镜像源:
  #国内清华大学
  echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
  #中科大源
  echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
  #立即生效
  source ~/.bash_profile
brew cask install cakebrew 


20190304
由于Homebrew/php自来水在2018年3月底弃用,并将所有 PHP 公式转移到Homebrew/core,旧的brew tap homebrew/dupes、brew tap homebrew/versions、brew tap homebrew/homebrew-php都会报以下错误(目前国内百度都找不到解决这个问题的方法):
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.

附上一些参考文章:

上一篇 下一篇

猜你喜欢

热点阅读