homebrew长时间停在Updating Homebrew 这个步骤
在国内的网络环境下使用 Homebrew 安装软件的过程中可能会长时间卡在 Updating Homebrew 这个步骤。
例:执行 brew install composer 命令
➜ ~ brew install composer
Updating Homebrew... # 如果碰到长时间卡在这里,参考以下 2 种处理方法
方法 1:按住 control + c 取消本次更新操作
➜ ~ brew install composer
Updating Homebrew...
^C
按住 control + c 之后命令行会显示 ^C,就代表已经取消了 Updating Homebrew 操作
大概不到 1 秒钟之后就会去执行我们真正需要的安装操作了
➜ ~ brew install composer
Updating Homebrew...
^C==> Satisfying dependencies
==> Downloading https://getcomposer.org/download/1.7.2/composer.phar
...
这个方法是临时的、一次性的
方法 2:使用 Alibaba 的 Homebrew 镜像源进行加速
平时我们执行 brew 命令安装软件的时候,跟以下 3 个仓库地址有关:
brew.git
homebrew-core.git
homebrew-bottles
通过以下操作将这 3 个仓库地址全部替换为 Alibaba 提供的地址
1. 替换 / 还原 brew.git 仓库地址
# 替换成阿里巴巴的 brew.git 仓库地址:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
#=======================================================
# 还原为官方提供的 brew.git 仓库地址
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
2. 替换 / 还原 homebrew-core.git 仓库地址
# 替换成阿里巴巴的 homebrew-core.git 仓库地址:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
#=======================================================
# 还原为官方提供的 homebrew-core.git 仓库地址
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
3. 替换 / 还原 homebrew-bottles 访问地址
这个步骤跟你的 macOS 系统使用的 shell 版本有关系
所以,先来查看当前使用的 shell 版本
echo $SHELL
# 如果你的输出结果是 /bin/zsh,参考?的 zsh 终端操作方式
# 如果你的输出结果是 /bin/bash,参考?的 bash 终端操作方式
3.1 zsh 终端操作方式
# 替换成阿里巴巴的 homebrew-bottles 访问地址:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
#=======================================================
# 还原为官方提供的 homebrew-bottles 访问地址
vi ~/.zshrc
# 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
source ~/.zshrc
3.2 bash 终端操作方式
# 替换 homebrew-bottles 访问 URL:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
#=======================================================
# 还原为官方提供的 homebrew-bottles 访问地址
vi ~/.bash_profile
# 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
source ~/.bash_profile
homebrew长时间停在Updating Homebrew 这个步骤的更多相关文章
- Mac 安装 homebrew 流程 以及 停在 Updating Homebrew等 常见错误解决方法
懒人操作顺序:S_01>>>S_02>>>S_03 首先这是homebrew的官网 https://brew.sh/index_zh-cn 安装方法是在终端中输入 ...
- Windows下Android Studio长时间停留在Building "Project Name" Gradle project info画面的解决方法
问题描述: 创建好一个Android项目后,Android Studio长时间停留在Building [Project Name] Gradle project info画面不动. 原因: 此时And ...
- 安装npm install时,长时间停留在fetchMetadata的解决方法
安装npm install时,长时间停留在fetchMetadata: sill mapToRegistry uri http://registry.npmjs.org/whatwg-fetch处, ...
- 安装npm install时,长时间停留在fetchMetadata: sill 解决方法——换npm的源
安装npm install时,长时间停留在fetchMetadata: sill mapToRegistry uri http://registry.npmjs.org/whatwg-fetch处, ...
- Updating Homebrew... 长时间不动解决方法
确保你已安装Homebrew 依次输入下面的命令(注意:不要管重置部分的命令,这里原作者贴出来.我也贴出来是以防需要重置的时候有参考操作命令) 替换brew.git: cd "$(brew ...
- 长时间停留在calculating requirements and dependencies 解决方案
如果Eclipse花费了很长的时间calculating requirements and dependencies(计算需求和依赖性 ) 这个问题通常就是在点击安装之后显示“Calculating ...
- 长时间停留在calculating requirements and dependencies 的解决方案
如果Eclipse花费了很长的时间calculating requirements and dependencies(计算需求和依赖性 ) 这个问题通常就是在点击安装之后显示“Calculating ...
- 长时间停留在calculating requirements and dependencies
如果安装插件的时候,Eclipse花费了很长的时间calculating requirements and dependencies(计算需求和依赖性 )这个问题通常就是在点击安装之后显示“Calcu ...
- Eclipse安装插件长时间停留在calculating requirements and dependencies
如果安装插件的时候,Eclipse花费了很长的时间calculating requirements and dependencies(计算需求和依赖性 ) 这个问题通常就是在点击安装之后显示" ...
随机推荐
- 3、变量+运算符+Scanner
1.变量 1>开辟内存空间 int num ; 2>赋值 num = 10; 3>使用 num 1*long 类型的特殊 long num = 12L 2*float类型特殊 flo ...
- Bash Specially-crafted Environment Variables Code Injection Vulnerability Analysis
http://www.cnblogs.com/LittleHann/p/3992778.html
- PAT甲级——A1066 Root of AVL Tree
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child sub ...
- socket工作原理深入分析
socket原理分析 本篇文章摘自https://www.cnblogs.com/zengzy/p/5107516.html,总结的很好,所以摘过来总结整理一下,如果朋友们还想更加深入的研究网络,推荐 ...
- 05-python 学习第五天,简易聊天工具(shelve模块练习)
需求:1.有两个用户,一个是mychat.py,另一个是youchat.py2.通过执自己的文件,可以看到对方输入的内容,实现连个命令行窗口之间聊天的功能.3.通过shelve 持久化写入和和读取功能 ...
- 795. Number of Subarrays with Bounded Maximum
数学的方式 是对于所有的字符分成简单的三类 0 小于 L 1 LR 之间 2 大于R 也就是再求 不包含 2 但是包含1 的子数组个数 不包含2的子数组个数好求 对于连续的相邻的n个 非2类数 就有 ...
- ES6之字符串学习
以下是常用的方法不是全部方法 1.codePointAt()方法 有一些字段需要4个字节储存,这样charCodeAt方法的返回就是不正确的,用codePointAt()方法就可以返回 十进制的值.如 ...
- Python PIL 怎么知道写入图片格式的kb大小
把图片数据写入一个IO,读这个IO的长度大小: #-*-coding:utf-8-*- from PIL import Image import io img = Image.open("1 ...
- Leetcode139. Word Break单词拆分
给定一个非空字符串 s 和一个包含非空单词列表的字典 wordDict,判定 s 是否可以被空格拆分为一个或多个在字典中出现的单词. 说明: 拆分时可以重复使用字典中的单词. 你可以假设字典中没有重复 ...
- Django项目:CRM(客户关系管理系统)--72--62PerfectCRM实现CRM讲师讲课记录
#urls.py """PerfectCRM URL Configuration The `urlpatterns` list routes URLs to views. ...