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

相关文章

方法: 打开一个新的可跨域的chrome窗口实现方法: 1. 打开终...
MacBook Pro 14价格和配置对比 尺寸 SOC	内存&#...
现在给大家介绍一下如何查询MAC的生产日期,希望对你查询MAC...
1、点击【编辑虚拟机设置】,转到【CD/DVD (SATA)】,选中【...
注意:用哪个版本的 Python 运行安装脚本,pip 就被关联到哪...
Mac 安装nvm