Homebrew 卡在 Updating Homebrew…

简介: Homebrew 卡在 Updating Homebrew…

正文


一、安装 Homebrew


看之前写的一篇【Homebrew 使用详解,macOS 的第二个 Mac App Store】文章,不再赘述了。


二、每次安装包卡在 Updating Homebrew 的问题


原因是 Homebrew 每次安装包的时候默认开启了自动更新的设置。可通过配置关闭掉。



# 在 .bash_profile 或者 .zshrc 添加一行配置(具体看自己终端默认 Shell 是 bash 还是 zsh)
# 1. 打开 (二选一)
$ vim ~/.bash_profile 
$ vim ~/.zshrc
# 2. 在对应文件,添加一行配置,并保存
export HOMEBREW_NO_AUTO_UPDATE=true
# 3. 刷新配置(二选一)
$ source ~/.bash_profile
$ source ~/.zshrc


还有一个比较狗血的方法就是:ctrl + c  跳过。但还是修改配置的方式一劳永逸。


三、brew install package 慢的问题


具体思路是替换 Homebrew 镜像源。


  1. 替换 brew.git


$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git


  1. 替换 homebrew-core.git


$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git


  1. 重置 brew.git


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


  1. 重置 homebrew-core.git


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


好吧,替换之后,我还是觉得慢。

目录
相关文章
|
5月前
homebrew
homebrew
80 0
|
6月前
Mac解决Updating Homebrew卡顿
Mac解决Updating Homebrew卡顿
60 0
|
8月前
|
缓存 开发工具 git
Homebrew安装
Homebrew安装
|
9月前
|
Shell iOS开发 MacOS
Homebrew brew update 长时间没反应(或卡在 Updating Homebrew...)
Homebrew brew update 长时间没反应(或卡在 Updating Homebrew...)
874 0
|
9月前
Mac brew 卡在 ‘Cloning into ‘.../homebrew-core(或 homebrew-cas)‘
Mac brew 卡在 ‘Cloning into ‘.../homebrew-core(或 homebrew-cas)‘
51 0
|
10月前
|
Linux Shell 开发工具
MacOS安装Homebrew与Oh-My-Zsh
MacOS安装Homebrew与Oh-My-Zsh
1037 0
|
网络协议
macbook中安装Homebrew 出现443错误
macbook中安装Homebrew 出现443错误
670 0
|
Ubuntu 数据安全/隐私保护
ubuntu18安装nvidia,重启出现perform MOK management
ubuntu18安装nvidia,重启出现perform MOK management
685 0
Mac电脑 - 解决 brew install 报错Error: /usr/local/Homebrew is not writable. 的问题
Mac电脑 - 解决 brew install 报错Error: /usr/local/Homebrew is not writable. 的问题
762 0
|
开发工具 git
brew一直卡在Updating Homebrew的解决办法
运行命令brew install pip3,结果界面一直卡在Updating Homebrew...上,有两种解决办法 方法一:直接关闭brew每次执行命令时的自动更新(推荐) vim ~/.
16655 0