brew: MacOS的包管理工具

brew是MacOS上类似于yum和apt-get的包管理工具,通过ruby脚本安装。本文介绍了brew的安装、版本确认、常用操作,如安装wget、查询已安装包及查看包详情。
摘要由CSDN通过智能技术生成

这里写图片描述
brew是MacOS上的包管理工具,像RHEL/CentOS上的yum或者Ubuntu上的apt-get一样,MacOS上使用brew也可以非常容易进行包的管理。

概要信息

项目 说明
官方网站 https://brew.sh
开源/闭源 开源
License类别 BSD 2-Clause “Simplified” License
代码管理地址 https://github.com/Homebrew/brew
开发语言 Ruby
支持平台 MacOS
当前版本 1.6.9 (2018/06/18)

事前确认

因为brew是ruby开发的,需要使用确认ruby已经安装,缺省状况下是已经安装的。

liumiaocn:~ liumiao$ which ruby
/usr/bin/ruby
liumiaocn:~ liumiao$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
liumiaocn:~ liumiao$ 

安装命令

具体的安装脚本在raw.githubusercontent.com已有,使用如下命令即可安装

安装命令:ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

安装日志

liumiaocn:~ liumiao$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following existing directories will have their owner set to liumiao:
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following existing directories will have their group set to admin:
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /usr/sbin/chown liumiao /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/
### 回答1: 这个错误提示是在使用终端命令行时出现的,表明系统无法找到"brew"这个命令。"brew"是一个常用于管理MacOS操作系统下的软件的工具,可能是由于未正确安装或未正确配置路径等原因导致无法使用该命令。 如果您是在MacOS操作系统下使用终端命令行,可以尝试重新安装Homebrew来解决问题。具体步骤如下: 1. 打开终端并输入以下命令来安装Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2. 安装完成后,在终端中输入以下命令来确保Homebrew已经正确安装: brew doctor 如果出现"Your system is ready to brew."的提示,则表示Homebrew已经安装成功。 3. 如果仍然出现"brew: command not found"的错误提示,则可能是由于系统路径配置不正确导致的。您可以在终端中输入以下命令来更新路径配置: echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile 然后重新启动终端并再次尝试使用"brew"命令。 希望这些步骤能够帮助您解决问题。如果问题仍然存在,建议您咨询更高级别的技术支持。 ### 回答2: 很抱歉,我需要更多的上下文或问题来回答您的问题。请给我更多的信息,我将尽我所能来回答您的问题。 ### 回答3: 很抱歉,您的问题描述不够明确,无法得知您是想了解什么内容,无法作出准确的回答。能否提供更多细节,让我更好地为您解答呢?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值