当前位置: 首页 > news >正文

Mac更新homebrew时卡住的解决办法

Mac更新homebrew时卡住的解决办法

  • 引起问题的原因
    • brew命令安装软件跟这3个仓库地址有关
      • 1、brew
      • 2、homebrew-core
      • 3、homebrew-bottles
      • 4、若/bin/zsh,则输入
      • 5、若/bin/bash,则输入
      • 6、更新brew

引起问题的原因

知其然,还要知其所以然。brew的更新仓库地址为:https://github.com/Homebrew/brew.git
看了地址,想想就知道是被墙了。

brew命令安装软件跟这3个仓库地址有关

brew.git
homebrew-core
homebrew-bottles

最快的解决方式,使用国内的镜像仓库:
Mac终端中,输入

1、brew

cd “$(brew --repo)”
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
还原:git remote set-url origin https://github.com/homebrew/brew.git)

2、homebrew-core

cd “$(brew --repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
还原:git remote set-url origin https://github.com/homebrew/homebrew-core.git)

3、homebrew-bottles

cd “$(brew --repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-bottles.git
还原:git remote set-url origin https://github.com/homebrew/homebrew-bottles.git)

输入:echo $SHELL
看输出是:/bin/zsh 或 /bin/bash

4、若/bin/zsh,则输入

echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles’ >> ~/.zshrc
source ~/.zshrc

还原:vi ~/.zshrc,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置)

5、若/bin/bash,则输入

HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles’ >> ~/.bash_profile
source ~/.bash_profile

还原:vi ~/.bash_profile,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置)

6、更新brew

brew update

如有报错,执行:brew update-reset
再执行:brew update

就可以使用brew进行安装了

http://www.lryc.cn/news/134432.html

相关文章:

  • 带你了解—在外远程群晖NAS-群晖Drive挂载电脑磁盘同步备份【无需公网IP】
  • 计算机网络第2章(物理层)
  • windows钩子保护自身进程不被破坏
  • Linux系统查看文件系统类型C代码
  • Python中的正则表达式
  • 第六章,创作文章
  • Win10c盘满了怎么清理?快速清理,5个方法!
  • 回归预测 | MATLAB实现GWO-BP灰狼算法优化BP神经网络多输入单输出回归预测(多指标,多图)
  • docker 06(docker compose)
  • 非阻塞重试与 Spring Kafka 的集成测试
  • 基于 Debian 12 的MX Linux 23 正式发布!
  • Nginx代理功能与负载均衡详解
  • 部署问题集合(特辑)虚拟机常用命令
  • 【Git】如何将本地文件进行Git仓库归档
  • uniapp 使用腾讯视频 的 坑
  • LinkedList
  • 创作新纪元:知乎、阅文加码AI大模型,撬动创作者经济
  • PAT(Advanced Level) Practice(with python)——1067 Sort with Swap(0, i)
  • Python爬取斗罗大陆全集
  • 前馈神经网络解密:深入理解人工智能的基石
  • 顺序栈Sequential-stack
  • 关于工牌(必须5-10个字)
  • PHP混淆加密以及常用的一些加密工具
  • 无涯教程-PHP - ereg()函数
  • 【Ubuntu】简洁高效企业级日志平台后起之秀Graylog
  • TCP特点UDP编程
  • 超级计算机
  • LeetCode863. 二叉树中所有距离为 K 的结点(相关话题:深度遍历,广度遍历)
  • Kotlin 基础学习
  • CW6B-90A-RCW6B-100A-RCW6B-110A-RCW6B-115A-R三相三线式滤波器