Mac下HomeBrew 替换镜像和复原

简介: HomeBrew 下载安装成功后,brew update 会一直卡着

替换现有上游(中科大镜像)

# brew 程序本身,Homebrew/Linuxbrew 相同
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

# 以下针对 mac OS 系统上的 Homebrew
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
git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git

# 以下针对 Linux 系统上的 Linuxbrew
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/linuxbrew-core.git

# 更换后测试工作是否正常
brew update

复原

# brew 程序本身,Homebrew/Linuxbrew 相同
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

# 以下针对 mac OS 系统上的 Homebrew
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
git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://github.com/Homebrew/homebrew-cask-fonts.git
git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://github.com/Homebrew/homebrew-cask-drivers.git

# 以下针对 Linux 系统上的 Linuxbrew
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/linuxbrew-core.git

# 更换后测试工作是否正常
brew update
目录
相关文章
|
5月前
|
监控 网络虚拟化
配置远程MAC镜像示例
配置远程MAC镜像示例
|
5月前
|
监控 网络虚拟化
配置本地MAC镜像示例
1. 创建VLAN10,将Switch与主机相连的接口加入VLAN10,实现主机与Switch间的二层互通。 2. 配置接口GE0/0/4为本地观察端口,负责向Server转发镜像报文。 3. 在VLAN10内配置MAC镜像,将VLAN10内指定MAC地址的主机访问Internet的流量复制一份到本地观察端口。
|
5月前
|
开发工具 git iOS开发
Mac 安装软件包管理工具Homebrew
Mac 安装软件包管理工具Homebrew
|
11月前
|
Java
Mac下安装JDK11(国内镜像)
Mac下安装JDK11(国内镜像)
2718 0
|
11月前
|
Java
Mac 下安装jdk1.7(国内镜像)
Mac 下安装jdk1.7(国内镜像)
1013 0
|
12月前
|
开发工具 数据安全/隐私保护 git
百度搜索:蓝易云【Mac 安装homebrew Mac安装Git教程。】
现在,您已成功在Mac上安装了Homebrew和Git。您可以使用Homebrew安装其他软件包,并使用Git进行版本控制和代码管理。 希望这些信息对您有所帮助!如果您有任何其他问题,请随时提问。
162 0
|
Linux Docker Python
|
1月前
|
Shell 数据安全/隐私保护
Mac上HomeBrew安装及换源教程
【8月更文挑战第30天】这是在 Mac 上安装及更换 Homebrew 源的教程。首先通过终端执行命令 `/bin/bash -c "\$\(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh\)` 安装 Homebrew,并使用 `brew --version` 检查是否安装成功。接着可更换软件源以提高下载速度,例如设置中科大为源,并更新相关设置。这将有助于提升 Homebrew 的使用体验。
252 9
|
5月前
|
内存技术
Mac nvm 切换为淘宝镜像
Mac nvm 切换为淘宝镜像
747 0
|
2月前
|
iOS开发 MacOS Python
【Mac 系统】解决已有清华镜像但出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url
在尝试使用清华镜像创建conda环境时遇到下载超时问题,通过删除原有镜像并添加针对Mac OS的清华镜像解决了该问题。
81 3
下一篇
无影云桌面