mac安装brew

brew安装

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

镜像:/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"

默认安装路径:/usr/local/Cellar

如果报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation

解决1、

输入指令:sudo gem install redis

重新安装

解决2、

浏览器输入地址:https://raw.githubusercontent.com/Homebrew/install/master/install

保存网页到本地,命名为brew_install.rb的文件

执行命令:/usr/bin/ruby -e brew_install.rb

解决3、raw.githubusercontent.com 被和谐了

https://www.ipaddress.com/查询raw.githubusercontent.com的真实IP

配置hosts:199.232.68.133 raw.githubusercontent.com

执行安装命令;

 

brew 常用安装命令:

  • brew tap #查看源
  • brew tap source #添加源
  • brew install package #安装软件包
  • brew uninstall package #卸载包
  • brew list #查看安装包
     

brew services命令使用:

  • brew install elasticsearch # 安装 elasticsearch
  • brew services start elasticsearch # 启动 elasticsearch
  • brew services stop elasticsearch # 停止 elasticsearch
  • brew services restart elasticsearch # 重启 elasticsearch
  • brew services list # 列出当前的状态

 

brew Updating Homebrew...   蜗牛

方法一:直接关闭brew每次执行命令时的自动更新(推荐)

 

brew update

vim ~/.bash_profile

# 新增一行

export HOMEBREW_NO_AUTO_UPDATE=true

source ~/.bash_profile

 

方法二:替换更新源

替换更新源

// 执行下面这句命令,更换为中科院的镜像:

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

 

// 把homebrew-core的镜像地址也设为中科院的国内镜像

 

cd "$(brew --repo)"

 

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

 

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

 

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

 

// 更新

brew update

 

// 使用

brew install node

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值