homebrew

homebrew安装

进入官网:https://brew.sh
进入终端复制粘贴下面的命令
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”
homebrew
一直等待直到显示如图所示的结果就表示安装成功
homebrew

如果安装过程中碰到了如下的问题:
curl: (7) Failed to connect to raw.githubuserscontent.com port 443:Connection refused
443问题一般是被墙了,这个时候我们只需要修改一下hosts文件就可以了。

在https://www.ipaddress.com中查raw.githubusercontent.com的真实ip
homebrew
在hosts文件中加入199.232.68.133 raw.githubusercontent.com即可

修改host文件

1.使用 sudo vi /etc/hosts进入hosts文件(注意vi后面有一个空格)
2.输入i进入输入模式,输入要添加的内容
3.按esc退出,接着按 :wq保存并退出
4.输入sudo dscacheutil -flushcache清理缓存