一、Homebrew是什么
Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。
援引官方的一句话:又提示缺少套件啦?别担心,Homebrew 随时守候。Homebrew —— OS X 不可或缺的套件管理器。
二、Homebrew安装和卸载
1.安装
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.卸载
$ cd `brew --prefix`
$ rm -rf Cellar
$ brew prune
$ rm `git ls-files`
$ rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
$ rm -rf .git
$ rm -rf ~/Library/Caches/Homebrew
注:便于自己使用,打开终端快捷方式,打开聚焦搜索:command+空格键,输入terminal.app,回车。
三、Homebrew安装遇到的问题
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused注意这里问题后缀是Connection refused
猜测的产生的原因:需要翻墙啦......
所以下面是我的解决办法:
(1)打开网站:https://www.ipaddress.com/
查询一下 raw.githubusercontent.com对应的IP 地址:

(2)替换系统的host文件
注意:最好复制一份出来在更改



这里其实相当于网络不通的解决方式,一个网址在你电脑上是否能打开,打不开 我们都会在终端(dos系统)ping 一下 举个例子:

(3)然后执行安装
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
(4)如果碰到hosts无法编辑,提示无权限

解决方法:

前往,然后选中etc文件夹右击,选中显示简介:

简介如图显示:

如果1所示处为只读,点击2处的🔐按钮,弹出如图所示,输入密码,点击”好“:

接下来,选择everyone权限框,弹出如图所示选项,选择”读与写“:

接下来重新操作上面第二步,替换系统的host文件
网友评论