mac OS简单实用的包管理器Homebrew,真的非常好用

前言

今天安装zookeeper时使用的是brew方式来安装,才深深的体会到brew的厉害之处,闲话少叙,进入正题。

Homebrew的使用

1. 安装Homebrew

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

在1中指令回车之后,会提示Press RETURN to continue or any other key to abort (回车继续或者按其他键终止),这是直接回车进入“Downloading and installing Homebrew…”,

  1. 如果网络不好的话可能会提示“fatal: unable to access ‘https://github.com/Homebrew/brew/’: SSLRead() return error -9806…等”,没关系重新输入1的指令更新。
  2. 用如下命令下载安装msf时,提示curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
    解决办法:
  • 打开 https://www.ipaddress.com/ 输入访问不了的域名,获得对应的IP。
  • 使用vim /etc/hosts命令打开不能访问的机器的hosts文件,添加如下内容:
199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com

注:上面内容中199.232.68.133是raw.githubusercontent.com所在的服务器IP(通过 https://www.ipaddress.com/ 获知)。
保存该文件,再使用即可正常访问。

正常安装完成之后会有如下提示:

HEAD is now at 2b6f47714 Merge pull request #4116 from commitay/zap-force
==> Cleaning up /Library/Caches/Homebrew...
==> Migrating /Library/Caches/Homebrew to /Users/maerfeifei/Library/Caches/Homeb
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

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

2. brew 常用命令(SoftwareName是你需要处理的软件的软件名)

  1. 查看软件最新版本,brew info SoftwareName例如
brew info zookeeper
  1. 安装软件,brew install SoftwareName例如
 brew install zookeeper
  1. 卸载软件:rew remove SoftwareName例如
 brew remove zookeeper
  1. 查看通过brew安装的所有软件
brew list

查看某个软件的安装路径

brew list 软件名
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

码农飞哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值