欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

homebrew安装

程序员文章站 2022-07-13 21:23:16
...

前言:前几年离不开homebrew,安装软件弄个命令超级便利,年初换了新mac,最近在安装homebrew遇到一些问题,安装顺利,总是告诉403错误,原因嘛,有墙,你懂。

==============================分界线==============================

正式开始

1. 首先去官网https://brew.sh/index_zh-cn

homebrew安装

2. copy命令到终端,回车。

/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

3. 浏览器访问https://raw.githubusercontent.com/Homebrew/install/master/install.sh 能够看到

homebrew安装

那就需要host文件来解决问题。

4.浏览器https://www.ipaddress.com/ 查询 raw.githubusercontent.com的ip地址

homebrew安装

我当前查询到的ip地址是199.232.68.133,你在配置时候,需要查询一次,地址可能会更新。

5.终端执行命令

sudo vi /etc/hosts

输入密码后,

添加一行

199.232.68.133 raw.githubusercontent.com

保存并退出。

6.再次执行步骤2,慢慢等着,大概300+MB,1个小时左右

~ $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
remote: Enumerating objects: 584, done.
remote: Counting objects: 100% (584/584), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 854 (delta 559), reused 561 (delta 545), pack-reused 270
Receiving objects: 100% (854/854), 205.52 KiB | 33.00 KiB/s, done.
Resolving deltas: 100% (626/626), completed with 157 local objects.
From https://github.com/Homebrew/brew
 * [new branch]          dependabot/bundler/Library/Homebrew/activesupport-6.0.3 -> origin/dependabot/bundler/Library/Homebrew/activesupport-6.0.3
 * [new branch]          dependabot/bundler/docs/activesupport-6.0.3 -> origin/dependabot/bundler/docs/activesupport-6.0.3
   8e984d621..61b98a5e2  master                                      -> origin/master
 * [new tag]             2.2.14                                      -> 2.2.14
 * [new tag]             2.2.15                                      -> 2.2.15
HEAD is now at 61b98a5e2 Merge pull request #7511 from rwhogg/tap-pin-command-explanation
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (13/13), done.
Receiving objects: 100% (717412/717412), 290.70 MiB | 19.00 KiB/s, done.
remote: Total 717412 (delta 8), reused 14 (delta 6), pack-reused 717393
Resolving deltas: 100% (473151/473151), done.
Tapped 2 commands and 4984 formulae (5,251 files, 318.6MB).
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh

==============================分界线==============================

后记:受环境限制,不能安装其他代理。如果你有vpn,可自行*,不需要这样做,而且速度也比较快。当然安装brew后,主要是使用tree命令,来扫一下代码src文件的目录结构,用于梳理文档。

相关标签: javascript linux