栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Mac解决Updating Homebrew卡顿

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Mac解决Updating Homebrew卡顿

文章目录

01 引言02 关闭提示03 替换镜像源

3.1 替换为ustc源3.2 替换为coding源3.3 替换为tsinghua源 04 恢复设置

01 引言

我们如果使用brew命令安装一些插件是,会卡在Updating Homebrew:

那么该如何解决呢?有两种方式:

    关闭提示(治标不治本)替换镜像源
02 关闭提示

首先看看关闭提示的方式,直接在控制台输入命令:

vim ~/.bash_profile

并在最后一行增加:

export HOMEBREW_NO_AUTO_UPDATE=true

最后使配置生效:

source ~/.bash_profile
03 替换镜像源 3.1 替换为ustc源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
brew update
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
brew update

我的本机操作成功了,如下图:

3.2 替换为coding源
cd "$(brew --repo)"
git remote set-url origin https://git.coding.net/homebrew/homebrew.git
brew update
3.3 替换为tsinghua源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git
brew update
04 恢复设置

如果以上设置都不行,则恢复默认设置:

cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/730414.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号