Mac OS安装包管理工具Homebrew教程

Homebrew的安装与使用

Homebrew官网

将次命令粘贴至终端:

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

使用 Homebrew 安装 Apple 没有预装但 你需要的东西。

$ brew install wget

Homebrew 会将软件包安装到独立目录,并将其文件软链接至 /usr/local 。

$ 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 安装到任意位置。


轻松创建你自己的 Homebrew 包。

$ brew create https://foo.com/bar-1.0.tgz
Created /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bar.rb

完全基于 git 和 ruby,所以自由修改的同时你仍可以轻松撤销你的变更或与上游更新合并。

$ brew edit wget # 使用 $EDITOR 编辑!

基本使用

安装软件

$  brew install xxx

卸载软件

brew uninstall wget

  

原文地址:https://www.cnblogs.com/Abner5/p/8176949.html