How To: Install Homebrew on Amazon Linux

I recently needed to get brew installed on an Amazon Linux EC2 server. I tried a few articles I found online, but ended up just building from source with four simple commands.

First, clone the Homebrew “Linuxbrew” git repository to your local machine by running the following command.

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

Next you’ll want to create a new directory for the compiled code.

mkdir ~/.linuxbrew/bin

Third you’ll want to make a link between the bin/brew folder from the git repository we pulled in earlier.

ln -s ../Homebrew/bin/brew ~/.linuxbrew/bin

Then finally you’ll want to enable the “brew” command to run from your shell.

eval $(~/.linuxbrew/bin/brew shellenv)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s