mac安装brew

安装brew

方式一(网速快的推荐):

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

方式二(网速慢的推荐):

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

vi brew_install

找到如下代码(新版本HomeBrew可能没有CORE_TAP_REPO这句代码,如果没有不用新增):
BREW_REPO = "https://github.com/Homebrew/brew".freeze
CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze
复制代码更改为:
BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git".freeze
CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core.git".freeze

执行脚本:
/usr/bin/ruby brew_install

此时脚本应该停在
==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…

解决方法,手动执行下面这句命令,更换为中科院的镜像:
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 doctor

卸载brew

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

文章作者: Ciwei
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Ciwei !
 上一篇
mac手动编译最新版RedisDesktopManager mac手动编译最新版RedisDesktopManager
源码地址:https://github.com/uglide/RedisDesktopManager 编译教程:http://www.garyqiang.com/post/how-to-build-redis-desktop-manag
2020-01-11
下一篇 
redis帮助类RedisUtil redis帮助类RedisUtil
RedisUtil介绍 最全的Java操作Redis的工具类,封装了对Redis五种基本类型的各种操作,力求符合Redis的原生操作,使用StringRedisTemplate实现! 快速导航:key命令操作 | String数据操作
2020-01-11
  目录