您当前所在位置:首页安装教程macOS安装brew教程

macOS安装brew教程

更新:2023-11-10 08:57:15编辑:tooool归类:安装教程人气:286

当你安装完macOS系统后,为了方便后续使用命令行安装软件,这时候你需要配置好brew包管理工具的环境。

macOS安装brew教程

那么这里来说明下如何配置安装吧。

1. github地址下载

由于一键下载shell脚本使用的raw.githubusercontent.com地址无法直接访问,所以我这里不使用这种方法。

下面教大家另外一个方法:

访问这个地址https://github.com/Homebrew/install/blob/master/install.sh进入代码页面,拷贝shell脚本的内容,保存到本地的install.sh

2. 修改shell脚本的资源链接,替换成中国镜像

把shell脚本这句

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

更改为

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

3.执行脚本

$ sh  install.sh

过程中,你输入输入密码,接着会要求输入一次回车,接着你会遇到这个卡住的日志:

==>Homebrewisrun entirelybyunpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brewdonations==>Tapping homebrew/core
Cloning into/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...

按住ctrl+c断开,我们来解决这个问题。

虽然我们已经安装brew命令成功了,但是要安装homebrew-core由于git地址的原因,我们需要执行以下命令来更换git源地址。

$cd"$(brew --repo)"$git remoteset-url origin https://mirrors.ustc.edu.cn/brew.git$cd"$(brew --repo)/Library/Taps/"$mkdir homebrew &&cdhomebrew$gitclonehttps://mirrors.ustc.edu.cn/homebrew-core.git

4.再次执行脚本

$ sh  install.sh

过程中,你输入输入密码,接着会要求输入一次回车,然后看到顺利执行完成。

==>Installation successful!

5.更新

$ brewupdateAlready up-to-date.

6.安装软件

这里以wget命令为例。

$ brew install wget

你学会了吗?希望对需要安装这个软件的你,有所帮助。

我告诉你msdn版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

win7点击网络中的计算机提示“没有启动服务器服务”怎么办 win7系统下启动tomcat提示8080端口被占用怎么办

游客 回复需填写必要信息