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

【MacOS】brew: command not found

程序员文章站 2022-05-09 20:54:14
...

老方式

这种方式已经废弃了:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

新方式

在线安转

/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: Operation timed out

则直接访问https://raw.githubusercontent.com/Homebrew/install/master/install.sh路径,保存文件本地安装,如图:

【MacOS】brew: command not found

拷贝内容保存到本地install.sh文件,然后执行install.sh:

vim install.sh  #拷贝内容
/bin/bash install.sh # 执行安装命令

完成标志

......
Receiving objects: 100% (728201/728201), 294.88 MiB | 362.00 KiB/s, done.
Resolving deltas: 100% (481105/481105), done.
Tapped 2 commands and 5032 formulae (5,301 files, 323.2MB).
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

验证

brew --version
Homebrew 2.3.0
Homebrew/homebrew-core (git revision db86b; last commit 2020-06-02)