GVKun编程网logo

Mac入门--通过homebrew下载过慢问题(mac安装homebrew速度太慢了)

15

本文将介绍Mac入门--通过homebrew下载过慢问题的详细情况,特别是关于mac安装homebrew速度太慢了的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也

本文将介绍Mac入门--通过homebrew下载过慢问题的详细情况,特别是关于mac安装homebrew速度太慢了的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也将涉及一些关于0001--Mac下通过homebrew安装mongoldb、fatal: unable to access ''https://github.com/Homebrew/homebrew-core/''、homebrew Mac 相关问题、Homebrew 卸载时出现:Failed to locate Homebrew! 错误的知识。

本文目录一览:

Mac入门--通过homebrew下载过慢问题(mac安装homebrew速度太慢了)

Mac入门--通过homebrew下载过慢问题(mac安装homebrew速度太慢了)

使用国内的镜像替换homebrew镜像,对镜像进行加速源

原先我们执行brew命令安装的时候,跟3个仓库地址有关 

1 brew.git

2 homebrew-core.git

3 homebrew-bottles

把三个仓库地址全部替换成国内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

 3.1 这个步骤跟你的macOs系统使用的shell版本有关系,首先查看shell版本

echo $SHELL

# 如果你的输出结果是 /bin/zsh,参考?的 zsh 终端操作方式
# 如果你的输出结果是 /bin/bash,参考?的 bash 终端操作方式

 3.2 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.3 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

 

以上就是今天的全部内容!

0001--Mac下通过homebrew安装mongoldb

0001--Mac下通过homebrew安装mongoldb

Mac下通过homebrew安装mongoldb

  1. 下载mongoldb ``` #如果没有curl,请执行brew install curl #安装homebrew参见(https://my.oschina.net/u/149702/blog/995742)
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.5.tgz
```
  1. 解压
    tar -zxvf mongodb-osx-x86_64-3.4.5.tgz
  2. 参考
    Install MongoDB Community Edition on OS X

fatal: unable to access ''https://github.com/Homebrew/homebrew-core/''

fatal: unable to access ''https://github.com/Homebrew/homebrew-core/''

LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54

安装
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE ''s|.*>node-(.*)\.pkg</a>.*|\1|p'')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
1
报错
==> Tapping homebrew/core
Cloning into ''/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core''...
fatal: unable to access ''https://github.com/Homebrew/homebrew-core/'': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.

解决:
// 执行下面这句命令,更换为中科院的镜像:
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

// 把homebrew-core的镜像地址也设为中科院的国内镜像

cd "$(brew --repo)"

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

// 更新
brew update

// 使用
brew install node

 

 

转自:https://blog.csdn.net/qq_42840269/article/details/81413875  十分感谢

homebrew Mac 相关问题

homebrew Mac 相关问题

homebrew 安装命令:

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” 

homebrew 默认安装路径: /usr/local/Cellar 

查看其配置命令:brew config 

安装指定路径 :brew install  /home/usersname/software(配置)

 

Homebrew 卸载时出现:Failed to locate Homebrew! 错误

Homebrew 卸载时出现:Failed to locate Homebrew! 错误

今天在 MacBook 上安装 Homebrew,结果中间断了网,想重新卸载重装,结果一直卸载失败。问题现象如下:

问题现象

卸载时错误如下:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Failed to locate Homebrew!

重装时错误如下:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin Cellar etc Frameworks Homebrew include lib opt sbin share var

问题分析

google 后发现有这样的问题讨论帖子,有人建议执行:

rm -rf /usr/local/.git

后再重新安装。貌似这个解决方案有很多人成功了。不过我这么做后还是出现卸载失败。

粗粗想了一下,大概因为是断网造成的,断网导致了安装不完全,在安装目录产生了一些不完整的目录文件。
查找了一下,找到一个目录
执行:

mdfind homebrew

找到:

/usr/local/Homebrew

cd/usr/local/目录,ls -al 了一下,发现还存在几个安装时出现过的目录名字,于是一并删除了。

下面是当初安装时的提示信息:

➜  local ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks

Press RETURN to continue or any other key to abort

下面是 ls -al 的信息:

➜  local ls -al
total 0
drwxr-xr-x  13 Ade   wheel  442  9 12 19:15 .
drwxr-xr-x@ 12 root  wheel  408 12  5  2015 ..
drwxrwxr-x   2 Ade   admin   68  9 12 19:15 Cellar
drwxrwxr-x   2 Ade   admin   68  9 12 19:15 Frameworks
drwxrwxr-x   3 Ade   admin  102  9 12 19:15 Homebrew

问题解决

删除 Homebrew 安装时产生的目录

rm -rf Cellar Frameworks Homebrew

重新执行安装命令:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

按照提示 回车 继续执行,
最后出现下面的提示表示安装成功

==> Installation successful!
==> Next steps
Run `brew help` to get started
Further documentation: https://git.io/brew-docs
==> Homebrew has enabled anonymous aggregate user behaviour analytics
Read the analytics documentation (and how to opt-out) here:
  https://git.io/brew-analytics

执行 brew help,正常显示命令帮助,Nice !

关于Mac入门--通过homebrew下载过慢问题mac安装homebrew速度太慢了的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于0001--Mac下通过homebrew安装mongoldb、fatal: unable to access ''https://github.com/Homebrew/homebrew-core/''、homebrew Mac 相关问题、Homebrew 卸载时出现:Failed to locate Homebrew! 错误的相关知识,请在本站寻找。

本文标签: