semantic_c0d3r
semantic_c0d3r

Reputation: 801

How to automate homebrew installation?

I'm deploying stuff on some unix machines and I need to get home-brew installed without any user prompt. Currently, the only way I found to install home-brew is to run this ruby script:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

But this has user prompts and cannot be fully automated. Can anyone suggest a way to install this without user prompts?

Upvotes: 8

Views: 5225

Answers (4)

jdlm
jdlm

Reputation: 6644

I don't know when this was added, but these days you can prepend the install command with NONINTERACTIVE=1 to avoid prompts:

NONINTERACTIVE=1 ruby -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Documentation

Upvotes: 2

ziff
ziff

Reputation: 369

The current implementation of the Homebrew installation script will prompt the User if stdin is set to TTY. By redirecting stdin to /dev/null, the installer can be run without user intervention.

'ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null'

Enjoy Peteris Krumins' awesome reference: Bash Redirections Cheat Sheet.

Upvotes: 5

Tim Smith
Tim Smith

Reputation: 6339

The Homebrew install script "just" checks permissions and clones the git repository. If you're on Linux, use Linuxbrew. Note the advice on the Linuxbrew home page that you can install by doing

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

and, in e.g. ~/.bash_profile:

export PATH="$HOME/.linuxbrew/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH"

to get everything set up.

You can do something similar on OS X. Make sure you have your filesystem permissions in order and git clone https://github.com/Homebrew/homebrew.git /usr/local (or wherever) and set up your PATH.

Upvotes: 0

maringan
maringan

Reputation: 195

You can use e.g. puppet(http://puppetlabs.com/puppet/what-is-puppet) and e.g. this puppet modul https://forge.puppetlabs.com/bjoernalbers/homebrew

Upvotes: 0

Related Questions