Terry : Linuxbrew

Linuxbrew

Linuxbrew is an experimental fork of Homebrew for Linux.


Install

Requirements

Debian / Ubuntu

sudo apt-get install build-essential curl git
 
# Or to be safer on a base install
sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev

Fedora / CentOS / Oracle Linux / RHEL

yum groupinstall 'Development Tools' && yum install curl git m4 ruby texinfo bzip2-devel curl-devel expat-devel ncurses-devel zlib-devel

 

Dependencies

  • Ruby 1.8.6 or newer
  • GCC 4.2 or newer

 Clone the repo from GitHub

git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew

Add the following in ~/.bashrc

# set path for Linuxbrew
if [ -d "$HOME/.linuxbrew" ]; then
    export PATH=$HOME/.linuxbrew/bin:$PATH
    export LD_LIBRARY_PATH=$HOME/.linuxbrew/lib
fi

Usage

 brew command

$ brew
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

Terminology

Terminology Homebrew speaks

NameDescriptionPath
FormulaThe package description~/.linuxbrew/Library/Formula
KegThe installation prefix of a Formula~/.linuxbrew/Cellar/tmux/1.8
CellarAll kegs are installed in here~/.linuxbrew/Cellar
TapAn optional repository (git) of Formula~/.linuxbrew/Library/Taps
BottlePre-built (binary) Keg that can be unpackedqt-4.8.4.mountain_lion.bottle.1.tar.gz

NOTE: More general: brew --prefix and brew --repository instead of ~/.linuxbrew (Linuxbrew) or /usr/local (OS X homebrew) but let's KISS.

Example

Install tmux

The Formula takes care of most ependencies, e.g. pkg-config, libevent.

 NOTE: see ~/.linuxbrew/Cellar directory for details.

However, it's missing libncurses5-dev package to compile tmux on Ubuntu/Debian. Install the pacakge and run

# Install
$ brew install tmux
==> Downloading http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.8/tmux
Already downloaded: /home/terry/.cache/Homebrew/tmux-1.8.tar.gz
==> Patching
patching file osdep-darwin.c
patching file utf8.c
==> ./configure --prefix=/home/terry/.linuxbrew/Cellar/tmux/1.8 --sysconfdir=/ho
==> make install
==> Caveats
Exmample configurations have been installed to:
  /home/terry/.linuxbrew/Cellar/tmux/1.8/share/tmux/examples
Bash completion has been installed to:
  /home/terry/.linuxbrew/etc/bash_completion.d
==> Summary
/home/terry/.linuxbrew/Cellar/tmux/1.8: 14 files, 736K, built in 10 seconds

# tmux 1.8 ;-)
$ tmux -V
tmux 1.8
$ brew info tmux
tmux: stable 1.8, HEAD
http://tmux.sourceforge.net
/home/terry/.linuxbrew/Cellar/tmux/1.8 (14 files, 736K) *
  Built from source
From: https://github.com//homebrew/commits/master/Library/Formula/tmux.rb
==> Dependencies
Build: pkg-config
Required: libevent
==> Caveats
Exmample configurations have been installed to:
  /home/terry/.linuxbrew/Cellar/tmux/1.8/share/tmux/examples
Bash completion has been installed to:
  /home/terry/.linuxbrew/etc/bash_completion.d

# list installed formula
$ brew list
libevent  pkg-config  tmux

# use the tmux from linuxbrew resides in $HOME
$ which tmux
/home/terry/.linuxbrew/bin/tmux

Enoy!

NOTE: Linuxbrew Cache directory ~/.cache/Homebrew

Reference

Linuxbrew https://github.com/Homebrew/linuxbrew

Formula Cookbook https://github.com/mxcl/homebrew/wiki/Formula-Cookbook