What is Homebrew? How to Install?

Homebrew is a package management system with similar functions to Fink1 and MacPorts2, which are alternatives for macOS operating system.

AA

Linux users will find it easy to use due to their familiarity with apt. A comparison of the aforementioned package management systems can be found in the article titled What are pros and cons for MacPorts, Fink and Homebrew?3. If we look at the basic usage;

brew install [package-name]

Installing Homebrew

Of course, our macOS operating system must have Homebrew installed for basic usage examples. Since there is no default package management system, installation must be done by the user4. Let's get started;

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

Yes, the above command will directly install Homebrew on our system. By the way, the Homebrew package management system is managed with the brew command. Let's test whether the installation has been completed smoothly after the installation above.

brew -v

This command will give us the version of Homebrew that has been installed. If there is an error message, you can get detailed information using the doctor parameter.

brew doctor

So now we can move on to package management operations. One more note, if you are sensitive about sharing personal information, you can turn off data sharing if it is open after the analytics query.

brew analytics
brew analytics off

Using Homebrew (brew)

Homebrew has a constantly evolving package library. You can search for any application you need in the library and quickly start the download process. For this purpose, you can use the brewformulas.org page for package searches. You can use the search parameter to search from the console. Let's assume we want to install the download manager named wget.

brew search wget

After the command, the packages with wget in their name will be listed. To view previously installed packages, it is sufficient to use the list parameter with brew.

brew list
brew cask list

To update the Homebrew package manager and package list installed on your system, use the update parameter. Also, an update is made with the update process before each installation. You can export installed applications through the list and include them in the system again from this output when the operating system is restructured.

brew update
brew update && brew upgrade

Let's move on to the package download process, this time we will use the install parameter. Again, I'm installing the wget download manager with brew using the above example.

brew install wget

You can use the reinstall parameter to reconfigure an existing installation, and the uninstall parameter to remove an installed package.

brew reinstall wget
brew uninstall wget

To link an installed application with a package definition, you can create a connection between the 2 fields with the link parameter.

brew link wget

Would you like to continue reading with the article titled Backup and Configuration Processes for Homebrew?

For more detailed information about Homebrew you can do the manual review man brew and/or browse the package documentation5. You can also track newly added or outdated packages via brewformulas.org.