homebrew卡住问题解决

2020-06-08  本文已影响0人  一只小茉莉

一、brew cask install xxx时卡住在cloning homebrew-cask

解决方法:
直接克隆Homebrew-cask镜像到本地(本地已经有brew和homebrew-core)
step1、创建Homebrew-cask库

sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask

step2、同步Homebrew-cask库

sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask

(ps:此处是清华源)

二、brew install xxx时卡住在update homebrew

解决方法:
1、contrl + c 关闭更新进程
2、替换镜像源:
替换brew.git

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

替换homebrew-core.git

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

替换homebrew-cask.git

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

(ps:
此处是中科大源,
换成清华源修改为

https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

换成阿里源修改为

https://mirrors.aliyun.com/homebrew/brew.git
https://mirrors.aliyun.com/homebrew/homebrew-core.git
https://mirrors.aliyun.com/homebrew/homebrew-cask.git

)
ps:
若是要重置则如下:

重置brew.git

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

重置homebrew-core.git

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

重置homebrew-cask.git

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

上一篇 下一篇

猜你喜欢

热点阅读