mac安装brew 软件包管理工具Homebrew
brew 全称Homebrew是Mac OSX上的软件包管理工具Homebrew 安装和卸载工具 只用一行命令就能完成
官方地址: http://brew.sh/index.html
mac 自带ruby
打开命令行terminal
输入:
view plain copy
https://code.csdn.net/assets/CODE_ico.pnghttps://code.csdn.net/assets/ico_fork.svg
[*]ruby -version
1) 安装命令
view plain copy
https://code.csdn.net/assets/CODE_ico.pnghttps://code.csdn.net/assets/ico_fork.svg
[*]ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
假如已经安装了输入如下命令
view plain copy
https://code.csdn.net/assets/CODE_ico.pnghttps://code.csdn.net/assets/ico_fork.svg
[*]ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
命令行输出:
2) brew 使用方法
命令行 输入:brew
输出:
view plain copy
https://code.csdn.net/assets/CODE_ico.pnghttps://code.csdn.net/assets/ico_fork.svg
[*]Example usage:
[*]brew
[*]brew install FORMULA...
[*]brew uninstall FORMULA...
[*]brew search
[*]brew list
[*]brew update
[*]brew upgrade
[*]brew pin/unpin
[*]
[*]Troubleshooting:
[*]brew doctor
[*]brew install -vd FORMULA
[*]brew [--env | config]
[*]
[*]Brewing:
[*]brew create ]
[*]brew edit
[*]open https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md
[*]
[*]Further help:
[*]man brew
[*]brew home
3) 安装工具
举个栗子: wget这个工具
输入命令: brew install wget
如图:
4)卸载
拿上面的栗子: wget 工具
输入命令 brew uninstall wget
5)工具安装的目录
Homebrew 会将套件安装到独立目录,并将文件软链接至/usr/local 。
view plain copy
https://code.csdn.net/assets/CODE_ico.pnghttps://code.csdn.net/assets/ico_fork.svg
[*]$ cd /usr/local
[*]$ find Cellar
[*]Cellar/wget/1.16.1
[*]Cellar/wget/1.16.1/bin/wget
[*]Cellar/wget/1.16.1/share/man/man1/wget.1
[*]
[*]$ ls -l bin
[*]bin/wget -> ../Cellar/wget/1.16.1/bin/wget
Homebrew 的所有文件均会被安装到预定义目录下,所以无需担心 Homebrew 的安装位置。6) 其他命令
brew list 列出已安装的软件
brew update 更新brew
brew home 用浏览器打开brew的官方网站
brew info 显示软件信息
brew deps 显示包依赖
更多命令请看: https://git.io/brew-docs
页:
[1]