MAC 安装homebrew流程

  1. 官网。 https://brew.sh/index_zh-cn
遇到第一个问题
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
解决办法:上 ipaddress 查 raw.githubusercontent.com 的IP地址,添加进 host:

打开访达:输入command+shift+g 输入 /etc 找到 hosts ,输入刚刚查到的IP地址和域名,例如:
199.232.68.133 raw.githubusercontent.com
回到终端,继续ping一下 github.com,如果ping得通就继续下面操作,如果time out,那么还是按照刚刚查IP的方法查一下github.com的IP并添加进hosts中,

最终hosts添加两行:


199.232.68.133 raw.githubusercontent.com
140.82.113.3 github.com
  1. 原文教程 :hhttps://www.jianshu.com/p/95d8f52fb1a8
  2. 原文教程 :https://zhuanlan.zhihu.com/p/90508170
  3. 如果官网命令 连接失败 请使用以下步骤
    /bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"

出现以下内容既安装成功

=> Pouring portable-ruby-2.6.8.arm64_big_sur.bottle.tar.gz
Warning: !!!!!!!!!!! 重要  !!!!!!!!!!!!!!!
Warning: 看到此提示,一定要执行 Next steps 中的 环境变量设置!!!
Warning: /opt/homebrew/bin is not in your PATH.
==> 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:
Warning: !!!!!!!!!!! 重要  !!!!!!!!!!!!!!!
切记执行环境变量设置!,如已执行过请忽略。
- 执行下面命令将 Homebrew 到 PATH:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/yangliting/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
  如有疑问,可以访问 https://brew.idayer.com/guide/m1/
- 🎉 恭喜,安装成功!运行 `brew help` 开始体验吧
- 更多文档: 
    https://docs.brew.sh
    https://brew.idayer.com


  1. 设置环境变量
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >>/Users/yangliting/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
  1. 设置镜像
vim ~/.bash_profile
echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
source ~/.bash_profile # 使刚才的配置立即生效

Homebrew 常用命令

比如我们需要安装mysql   //版本会自动给我们选一个最近稳定的版本。 也可以指定版本

brew  install mysql  //安装mysql

brew search mysql  //搜索mysql

brew info mysql    //   查找mysql相关信息

brew update     //更新自己的Homebrew

brew outdated   //会显示哪些软件可以升级

brew upgrade     //升级所有软件(后面不加名字)

brew upgrade  mysql  //    升级mysql软件

brew cleanup    //定期清理一些安装包缓存

brew list      //显示已经安装的软件

brew uninstall xx //卸载某些软件
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值