Home Brew - Mac

by lowededwookie in Circuits > Software

1041 Views, 0 Favorites, 0 Comments

Home Brew - Mac

homebrew-256x256.png

This Instructable is going to be used in a couple of other documents and so I decided to separate it out in order to prevent doubling up in the other Instructables I will be writing.

This Instructable will guide you through the process for install HomeBrew which will allow a number of UNIX applications to be installed on macOS.

Install Xcode

Screen Shot 2017-01-26 at 1.27.13 PM.png

The whole process is reliant on Xcode being installed but good news is it doesn't need the full version of Xcode to be installed.

However, for sake of simplicity I'm going to recommend downloading the full version of Xcode from the Mac App Store as this will install a number of powerful development tools for macOS while also installing the command line tools needed for Home Brew.

Once downloaded run the app and accept the dialog boxes that come up. This should include installing the command line tools.

Run Terminal

Screen Shot 2017-01-26 at 1.30.22 PM.png

I'm using macOS Sierra so to run Terminal I simply click the Rocketship in the Dock then in the Launchpad window I click Other then locate and click on Terminal.

Installing Brew

Screen Shot 2017-01-26 at 1.34.53 PM.png

Copy and paste the below code into the Terminal window:

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

This will download and install HomeBrew from the command line.

Press Return

Screen Shot 2017-01-26 at 1.35.05 PM.png

You will be greeted with a screen that tells you what is going to happen.

Simply follow the prompt to press the RETURN key

Enter Your Password

Screen Shot 2017-01-26 at 1.35.18 PM.png

When you installed your machine it would have asked you to create a username and password.

The password you need to enter is this one and only this one.

When entering the password you will not see any indicators as to what the password is so make sure you get it right.

Press RETURN key once you've typed the password.

Just Let It Run

Screen Shot 2017-01-26 at 1.35.24 PM.png

This process will take some time and there's NOTHING you can do so walk away and grab a cup of coffee (or tea if you're as sophisticated as me ;-) ).

Finished - Sort Of

Screen Shot 2017-01-26 at 1.55.24 PM.png

The install is finished but not completed.

There's a couple of options that need to happen.

Add the Path to Your Terminal Profile

Screen Shot 2017-01-26 at 2.16.02 PM.png

Many UNIX commands installed outside of macOS can't be found and you'll get errors about commands not being found. This is an easy fix by simply adding a path. The beauty of HomeBrew is that it uses a generally uniform path for everything so it will still need to be added to your Terminal profile.

Simply copy and paste this command to the Terminal and press RETURN:

echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

This will create a text file that Terminal reads. As Terminal is running already it won't reread this file so simply press Command W then press Command N.

This will close the existing window then open a new one.

DO NOT PRESS Command Q as this will close the application. If you do do this simply rerun Terminal.

Call the Doctor

Screen Shot 2017-01-26 at 2.02.10 PM.png

Now that HomeBrew has been installed and Terminal has the correct path settings you need to make sure HomeBrew is good to go.

The simple check is as follows:

brew doctor

Ready to Brew

Screen Shot 2017-01-26 at 2.08.50 PM.png

If there are no issues you should see the message

Your system is ready to brew

Update Brew

Screen Shot 2017-01-26 at 2.09.00 PM.png

Even though you've just installed HomeBrew there could be updated files during the process so type:

brew update

All Good

Screen Shot 2017-01-26 at 2.09.09 PM.png

If it's all good then there is one last command

Upgrades Are Not the Same As Updates

Screen Shot 2017-01-26 at 2.09.21 PM.png

Type:

brew upgrade

This installs later major versions of software not updates within the current version. Think of it as installing macOS Sierra from macOS El Capitan instead of installing macOS El Capitan 10.11.1 etc.

Finally Installed

Screen Shot 2017-01-26 at 2.09.30 PM.png

HomeBrew has now finished installing, has been configured to be found every time you use Terminal, has been updated and upgraded and checked that all is fine.

You can now install any application that is in the HomeBrew database.