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

本质原因是mac10.15安全等级提升,不允许远程执行脚本,那么解决方法就是用本地进行执行:

brew官方网站:https://brew.sh/

正常情况下,按照官网这行命令就解决了,但报错如题目所示

那换一种思路:把上面后半段网址的内容复制到本地:https://raw.githubusercontent.com/Homebrew/install/master/install.sh

1、先在本地创建一个文本 例如叫brew_install的文件

2、把上面的内容全部复制进去

3、用终端执行:

/bin/bash brew_install

如果提示没有同意xcode,按提示来就行,最后agree一下

4、慢慢等待按照,界面如下(我已经开代理了速度还是这么慢)

5、如果嫌弃慢,可以更改镜像,在原文中找到

BREW_REPO="https://github.com/Homebrew/brew"

整句替换为

BREW_REPO="https://mirrors.ustc.edu.cn/brew.git"

安装完成后,可以继续设置镜像地址,如果有代理可以忽略:进入下面的 Taps 目录,clone homebrew-core

cd /usr/local/Homebrew/Library/Taps/homebrew (如果没有homebrew,新建homebrew文件夹)

git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

把homebrew repo切换为清华镜像

cd "$(brew --repo)"

git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

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

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

brew update




可以参考简书链接:https://www.jianshu.com/p/fdf7e316f096
 

猜你喜欢

转载自blog.csdn.net/qq_34419607/article/details/106231815
今日推荐