一。brew官网主页上的方法:

/usr/bin/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

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
remote: Counting objects: 247, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 247 (delta 196), reused 201 (delta 196), pack-reused 46
Receiving objects: 100% (247/247), 45.99 KiB | 37.00 KiB/s, done.
Resolving deltas: 100% (204/204), completed with 71 local objects.
From https://github.com/Homebrew/brew
96eb404af..3a99e6464 master -> origin/master
HEAD is now at 3a99e6464 Merge pull request #4593 from reitermarkus/curl-options
fatal: unable to access 'https://github.com/Homebrew/brew/': SSLRead() return error -9806
Error: Fetching /usr/local/Homebrew failed!
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': SSLRead() return error -9806
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.
Failed during: /usr/local/bin/brew update --force

结论:安装失败。

注意:无论翻墙与否都链接不上,只能换方法。

二。使用国内镜像

1. 生成文件
cd ~
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

编辑生成的文件brew_install,并且修改2个配置项:
#BREW_REPO = "https://github.com/Homebrew/brew".freeze
BREW_REPO = "git://mirrors.ustc.edu.cn/brew.git".freeze
#CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze
CORE_TAP_REPO = "git://mirrors.ustc.edu.cn/homebrew-core.git".freeze

注释掉BREW_REPO = "https://github.com/Homebrew/brew".freezeCORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze

修改为BREW_REPO = "git://mirrors.ustc.edu.cn/brew.git".freezeCORE_TAP_REPO = "git://mirrors.ustc.edu.cn/homebrew-core.git".freeze

2. 执行安装

/usr/bin/ruby ~/brew_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

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
HEAD is now at 3a99e6464 Merge pull request #4593 from reitermarkus/curl-options
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4808, done.
remote: Compressing objects: 100% (4601/4601), done.
remote: Total 4808 (delta 60), reused 568 (delta 16), pack-reused 0
Receiving objects: 100% (4808/4808), 3.89 MiB | 107.00 KiB/s, done.
Resolving deltas: 100% (60/60), done.
Tapped 2 commands and 4593 formulae (4,849 files, 12.2MB).
==> Cleaning up /Library/Caches/Homebrew...
==> Migrating /Library/Caches/Homebrew to /Users/jsecode/Library/Caches/Homebrew...
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics.html

==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh

结论:安装成功。

后来在家重新试了下官网方法,又可以安装了。

JSEcodedeMacBook-Pro:nginx shihw$ /usr/bin/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

Press RETURN to continue or any other key to abort

==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew

Password:

==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew

==> /usr/bin/sudo /usr/sbin/chown shihw /Library/Caches/Homebrew

==> Downloading and installing Homebrew...

remote: Counting objects: 62, done.

remote: Compressing objects: 100% (4/4), done.

remote: Total 62 (delta 48), reused 51 (delta 48), pack-reused 10

Unpacking objects: 100% (62/62), done.

From https://github.com/Homebrew/brew

28fd59672..545eb91c8  master     -> origin/master

HEAD is now at 545eb91c8 Merge pull request #4599 from reitermarkus/download-cache-directory

Updated 1 tap (homebrew/core).

==> Cleaning up /Library/Caches/Homebrew...

==> Migrating /Library/Caches/Homebrew to /Users/jsecode/Library/Caches/Homebrew...

==> Deleting /Library/Caches/Homebrew...

==> New Formulae

gptfdisk                                                                                  pijul

==> Updated Formulae

abcde               cython              emscripten          grpc                ocrmypdf            ripgrep             taskell             vcftools            yarn

awscli              dartsim             erlang@20           hashcat             openshift-cli       rust                teleport            webpack             youtube-dl

cargo-completion    dbus                gammaray            knot-resolver       paket               shibboleth-sp       tmux-xpanes         wireguard-tools

chronograf          dxpy                go-statik           liquigraph          proselint           skaffold            todolist            xml-security-c

==> Installation successful!

==> Homebrew has enabled anonymous aggregate user behaviour analytics.

Read the analytics documentation (and how to opt-out) here:

  https://docs.brew.sh/Analytics.html

==> Next steps:

- Run `brew help` to get started

- Further documentation:

https://docs.brew.sh

JSEcodedeMacBook-Pro:nginx shihw$ brew update

Already up-to-date.

JSEcodedeMacBook-Pro:nginx shihw$



 

Mac环境 安装brew的更多相关文章

  1. Mac上安装brew

    用过ubuntu系统的都知道,上面有一个命令apt-get 很方便可以快速的安装很多软件 特别lamp环境 都是一键安装. 在mac上也有类似的命令 brew brew用法可以访问官网地址  http ...

  2. MAC下安装Brew[转]

    MAC下安装Brew 1.安装XCode xcode-select --install 2.安装HomeBrew ruby -e "$(curl -fsSL https://raw.gith ...

  3. Appium——appium之mac环境安装

    一.安装brew:Homebrew是一款Mac OS平台下的软件包管理工具执行:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubuserco ...

  4. Mac下安装brew

    1.Mac 终端下,执行以下命令,即可安装brew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Hom ...

  5. Mac上安装brew 包管理工具

    Mac 上的包管理工具对于开发者来说是一件非常方便的工具,能够有效的对包进行管理. 所以这篇博客就来简单的讲一下brew 的安装和一些基础命令. brew 全称叫做Homebrew . 1. 首先来说 ...

  6. mac下安装Brew 警告:Warning: /usr/local/bin is not in your PATH.

    终端输入命令 export PATH=/usr/local/bin:$PATH

  7. Mac环境安装非APP STORE中下载的软件,运行报错:“XXX” is damaged and can’t be opened. You should move it to the Trash. 解决办法

    出现这个错误的大多数原因都是因为系统设置的问题,因为系统不信任你从其他地方下载的软件安装包,所以运行时就给你阻止了.具体的设置步骤如下: 1. 打开系统偏好设置 (System Preferences ...

  8. homebrew & brew cask使用技巧及Mac软件安装

    homebrew 安装 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/m ...

  9. Mac环境下升级gcc版本--rocksdb

    前言 在mac环境下编译rocksdb,需要配置依赖的编译环境,其中有一项比较麻烦:c++编译要支持C++11,但是在mac环境安装xcode-select --install之后,已经安装有了gcc ...

随机推荐

  1. 【代码笔记】Web-JavaScript-JavaScript调试

    一,效果图. 二,代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...

  2. oppo手机屏幕录制的详细操作技巧

    说起屏幕录制,肯定我们都使用过各式各样的录屏工具,不管是手机或者电脑自带的,还是第三方录屏工具,是不是都出现过不能正常录屏的,或者没有把声音录制下来等一系列问题,为了给更多的人节约时间,因为笔者使用的 ...

  3. 腾讯.NET&PHP面试题

    在整个面试过程中,作为面试者的你,角色就是小怪兽,面试官的角色则是奥特曼,更不幸的是,作为小怪兽的你是孤身一人,而奥特曼却往往有好几个助攻,你总是被虐得不要不要的~ 作为复读一年才考上专科的我,遗憾的 ...

  4. 利用SurfaceView显示正弦曲线,仿造示波器

    众所周知,view是通过刷新来重绘视图的,Android系统通过发出VSYNC信号来进行屏幕重绘,刷新的时间间隔为16ms,如果在16ms内view完成你所需要的所有操作,那么用户在视觉上就不会产生卡 ...

  5. Android项目实战(四十九):Andoird 7.0+相机适配

    解决方案类似: Android项目实战(四十):Andoird 7.0+ 安装APK适配 解决方法: 一.在AndroidManifest.xml 文件中添加 四大组件之一的 <provider ...

  6. Django 系统日志logging

    Django使用Python内建的logging模块去建造自己的系统日志的,如果你想详细了解这个模块的话,请自己去看python的说明文档,这里仅仅介绍Django中的日志系统. 日志配置包括四个部分 ...

  7. ORACLE实际执行计划与预估执行计划不一致性能优化案例

      在一台ORACLE服务器上做巡检时,使用下面SQL找出DISK_READ最高的TOP SQL分析时,分析过程中,有一条SQL语句的一些反常现象,让人觉得很奇怪: SELECT SQL_ID,    ...

  8. 【转】JSF中的三大核心组件 UI标签的详细介绍和使用举例

    JSF提供了大量的UI标签来简化创建视图.这些UI标签类似于ASP.NET中的服务器组件.使用这些标签,可以通过其value,binding,action,actionListener等属性直接绑定到 ...

  9. Vue2 学习笔记1

    什么是Vue.js Vue.js 是目前最火的一个前端框架,React是最流行的一个前端框架(React除了开发网站,还可以开发手机App,Vue语法也是可以用于进行手机App开发的,需要借助于Wee ...

  10. mcelog用法详解

    手动启动mcelog方法: # mcelog --daemon Run mcelog in daemon mode, waiting for errors from the kernel. 后台服务启 ...