MacOS homebrew Package Manager

Homebrew installs packages to their own directory

Homebrew installs the stuff you need that Apple didn’t.

$ brew install wget
Homebrew installs packages to their own directory and then symlinks their files into /usr/local.

$ cd /usr/local
$ find Cellar
Cellar/wget/1.12
Cellar/wget/1.12/bin/wget
Cellar/wget/1.12/share/man/man1/wget.1

$ ls -l bin
bin/wget -> ../Cellar/wget/1.12/bin/wget

Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.

Create your own Homebrew packages

Trivially create your own Homebrew packages.

$ brew create http://foo.com/bar-1.0.tgz
Created /usr/local/Library/Formula/bar.rb
It's all git and ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.

$ brew edit wget # opens in $EDITOR!
Homebrew formulae are simple Ruby scripts:

require 'formula'

class Wget < Formula
  homepage 'http://www.gnu.org/wget/'
  url 'http://ftp.gnu.org/wget-1.12.tar.gz'
  md5 '308a5476fc096a8a525d07279a6f6aa3'

  def install
    system "./configure --prefix=#{prefix}"
    system 'make install'
  end
end
Homebrew complements OS X. Install your gems with gem, and their dependencies with brew.

Comandos

[~/local/src/ruby/sinatra/jump-start-sinatra]$ brew --help
Example usage:
  brew [info | home | options ] [FORMULA...]
  brew install FORMULA...
  brew uninstall FORMULA...
  brew search [foo]
  brew list [FORMULA...]
  brew update
  brew upgrade [FORMULA...]

Troubleshooting:
  brew doctor
  brew install -vd FORMULA
  brew [--env | --config]

Brewing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]
  open https://github.com/mxcl/homebrew/wiki/Formula-Cookbook

Further help:
  man brew
  brew home

HOMEBREW_GITHUB_API_TOKEN

A personal GitHub API Access token, which you can create at https://github.com/settings/applications. If set, GitHub will allow you a greater number of API requests. See http://developer.github.com/v3/#rate-limiting for more information.

Homebrew uses the GitHub API for features such as brew search.

$ brew search postgress
Error: GitHub Server Error
You may want to create an API token: https://github.com/settings/applications
and then set HOMEBREW_GITHUB_API_TOKEN.
Vete a la página y crea el token. Luego añade una línea como esta en tu .bashrc:
$ export HOMEBREW_GITHUB_API_TOKEN fx0001111111111111111111111eeeeeeeeeeeee
$ brew search postgress
No formula found for "postgress". Searching open pull requests...

Véase

  1. brew(1) - The missing package manager for OS X
  2. Homebrew Demystified: OS X’s Ultimate Package Manager



Subsecciones
Casiano Rodriguez León 2015-01-07