美文网首页
homebrew卡住问题解决

homebrew卡住问题解决

作者: 一只小茉莉 | 来源:发表于2020-06-08 21:49 被阅读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

相关文章

网友评论

      本文标题:homebrew卡住问题解决

      本文链接:https://www.haomeiwen.com/subject/xjbdtktx.html