Homebrew长时间显示Updating Homebrew...的对应方法

在这里插入图片描述
使用Homebrew安装automake,提示Updating Homebrew…之后长时间等待,可以使用如下方法予以应对。

方式1: Control + C取消更新

liumiaocn:tmux liumiao$ brew install automake
Updating Homebrew...
^C

==> Installing dependencies for automake: autoconf
==> Installing automake dependency: autoconf
==> Downloading https://homebrew.bintray.com/bottles/autoconf-2.69.high_sierra.bottle.4.tar.gz
...省略
==> Caveats
==> autoconf
Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/autoconf
liumiaocn:tmux liumiao$

方式2: 临时禁用Homebrew更新

卡住的地方在于更新,方式一中断的是更新,中断之后安装继续,所以能够成功。与之类似的方式就是临时禁用Homebrew更新,可以通过环境变量来设定HOMEBREW_NO_AUTO_UPDATE来达到同样目的,这里由于之前已经设定成功,所以显示已经安装完成。

liumiaocn:tmux liumiao$ export HOMEBREW_NO_AUTO_UPDATE=true
liumiaocn:tmux liumiao$ brew install automake
Warning: automake 1.16.1 is already installed and up-to-date
To reinstall 1.16.1, run `brew reinstall automake`
liumiaocn:tmux liumiao$ 

方式3: 换源

无论是方式1还是方式2,都是不进行更新的方式,换成可用的源即可解决问题,通过目前确认的结果,清华的源仍然可用。需要换的git的源的信息主要如下:

repo中科大源清华源
brew.githttps://mirrors.ustc.edu.cn/brew.githttps://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
homebrew-core.githttps://mirrors.ustc.edu.cn/homebrew-core.githttps://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
homebrew-bottlesexport HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottlesexport HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
  • 步骤1: 设定brew.git
liumiaocn:~ liumiao$ cd /usr/local/Homebrew/
liumiaocn:Homebrew liumiao$ git remote -v
origin	https://github.com/Homebrew/brew (fetch)
origin	https://github.com/Homebrew/brew (push)
]liumiaocn:Homebrew liumiao$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
liumiaocn:Homebrew liumiao$ git remote -v
origin	https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (fetch)
origin	https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (push)
liumiaocn:Homebrew liumiao$ 
  • 步骤2: 设定homebrew-core.git
liumiaocn:Homebrew liumiao$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
liumiaocn:homebrew-core liumiao$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
liumiaocn:homebrew-core liumiao$ git remote -v
origin	https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git (fetch)
origin	https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git (push)
liumiaocn:homebrew-core liumiao$

这两步设定完毕之后即可执行brew update了

  • 步骤3: 执行brew update
liumiaocn:homebrew-core liumiao$ brew update
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring portable-ruby-2.6.3.mavericks.bottle.tar.gz
Updated 2 taps (homebrew/core and homebrew/services).
==> New Formulae
...省略
==> Deleted Formulae
...省略
liumiaocn:homebrew-core liumiao$
  • 复原方法
    如需复原则使用相同的上述步骤,只需要替换对应的链接地址即可,具体命令如下所示:
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

brew update
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值