安装 Homebrew时报错

在安装Homebrew执行命令

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"	

此时爆出一个错误

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused	

该问题由于域名解析出问题,换成ip即可
网站 查询raw.githubusercontent.com的真实IP
在这里插入图片描述

电脑上修改hosts文件内容

$ sudo vim /etc/hosts	

添加内容199.232.28.133 raw.githubusercontent.com

再执行安装命令就可以了

千年以后。。。
又报错了

Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` 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	

还能说什么,获取国外文件如同与外星人取得联系。
一不做,二不休,还是切到国内数据源吧

替换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	

替换时又提示

cd: no such file or directory: /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	

好了 继续上面得步骤吧
执行

$ brew update	

检查下有没有错误

$ brew doctor

此时在执行brew -v结果 Homebrew 2.4.0
暂时OK吧,以后还需要什么再补充吧

不喜欢麻烦的,直接开小飞机把数据运回来吧

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值