更改 homebrew 镜像源

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

  • homebrew 的安装详见传送门,由于 homebrew 的镜像是国外的,每次下载更新速度较慢、需要翻墙;所以我们可以配置下将镜像源文件改为国内的(此处用的清华大学的)
vim ~/.bash_profile
echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
source ~/.bash_profile # 使刚才的配置立即生效
  • Homebrew 常用命令:
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
  • 安装 cakebrew, cakebrew 可理解为 homebrew 的可视化操作工具;
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.

附上一些参考文章:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容