DEV Community

Cover image for Homebrew - One package manager to rule them all
Chris Bongers
Chris Bongers

Posted on • Originally published at daily-dev-tips.com

Homebrew - One package manager to rule them all

If you are on Mac and needed to install some kind of package or software the changes you came across Homebrew are about 99%.

Homebrew is a package manager for Mac, it makes it easy to install different software. Or even different versions of for instance PHP.

You use homebrew in your terminal, my favorite terminal is iTerm2.

Homebrew list installed packages

Installing homebrew on Mac

The installation is one of the easiest I've ever seen.

Open up your terminal and execute the following command.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

That will install the latest version of homebrew.

Using homebrew

To use homebrew you can again open your terminal and run brew commands.

A list of useful commands:

  • brew --version: Display the installed version of homebrew
  • brew help: Display the help
  • brew doctor: Check the system for potential issues
  • brew update: Fetch the latest homebrew version
  • brew upgrade: Upgrade all brews (packages)
  • brew list: List all installed packages
  • brew install <formulae>: install specific formula
  • brew services start <service>: Start a specific service

Installing specific packages

To install specific packages we can generally follow the following guide.

Note: this example uses httpd as the package, you can find all homebrew formulae's here

  1. brew install httpd

Done... Literally, just that one command will install httpd and everything it needs.

In this case, since it's a service we can use homebrew to start it.

brew services start httpd
Enter fullscreen mode Exit fullscreen mode

Amazing right!

If you are on Mac and not running homebrew, make the change today, it will change your life!

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Top comments (0)