When we develop a production software(like, eCommerce website, or an SaaS) it's never just one programming language that satisfies all the requirements, and we end up using various libraries and software packages, which we must install on our server for the software to run. For example, if you develop a web application in Java using Jax-RS API like: Jersey, RESTeasy etc for REST services, then to run this software you must install Java and the other libraries/APIs used on the server. Also during development, you will have to install these packages in your local computer too.
Homebrew is a software package manager for Mac OS which can be used to install required packages, libraries etc to setup your local development requirements.
Another example, if you decide to learn Python, how will you do that? You will use online tutorials to learn the basics of the language and then practice by creating small programs/scripts in python. Now to run/execute these scripts you will have to install python in your local computer, again, how will you do that? If you are a mac user, you can use Homebrew.
I'm trying to install Wine on my Mac via Brew. I'm using Catalina and just updated brew, installed XQuartz and have Xcode installed. When I type the command 'Brew install wine' it returns the following: Error: No available formula with the name 'wine' Searching for a previously deleted formula (in the last month). Install Apache Spark using Homebrew. Homebrew can be used to install other technologies like Apache Spark. Apache Spark is not the easiest to install, but Homebrew makes it easier. The steps below go over how to install Apache Spark using Homebrew. Look to see if there is a Apache Spark package on Homebrew using the command below. Installing Homebrew on a Mac Installation. Homebrew is package manager for Macs which makes installing lots of different software like Git, Ruby, and Node simpler. Homebrew lets you avoid possible security problems associated with using the sudo command to install software like Node.
Install software packages required for setting up local development environment in your macOS.
Not only this, you can even use Homebrew to install other softwares like VLC, Google Chrome etc.
You can install all the UNIX Tools on your macOS using Homebrew.
Using Homebrew Cask, which is an extensuion of Homebrew, you can even install Binary apps(DMG files)
What happens Behind the Scene?
Whenever we install a new software package or tool, it should be installed in the /usr/local directory, as this is the directory where user specific software packages are installed. Homebrew installs the packages inside this directory, or at times, it installs the packages in their own directory and then symlinks(create soft link) their files into /usr/local/ directory
Belwo we have a step by step guide to install Homebrew on your computer/laptop
Step 1
To install and run Homebrew on macOS we need to install Command Line Tools on our mac. If you have XCode installed on your local environment then you do not need to do anything and can directly jump to the next step.
To install Command Line Tools, open your terminal(Press Command Spacebar and type in 'Terminal' to open the Terminal App) and run the following command.
The above command will install command line tools in your computer, or if you already have that installed, it will show the message 'error: command line tools are already installed'.
Step 2
To install Homebrew, run the following command,
Running this script requires password, so when it asks for the password, provide your user passowrd and press 'Enter'
Once this command executes without error(if you get any error, post in comment and we will help you out)
Step 3
Run the following command to see if everything is installed fine.
This will inform you about the status of Homebrew and will ask you to update a few packages, if required.
Step 4
Once the installation process is done, we will now put the Homebrew directory at the top of the environment variable PATH in our system. You must be wondering, why we need to do this? Well, to ensure that the Homebrew installations(software packages installed using Homebrew) are given priority over the default Mac OS X tools selected by the OS.
Open or create the ~/.bash_profile file using nano editor:
Write the following in the file:
To save the file, once you have added the above line to it, press the control key and the letter O, then press the Enter key. Then you can exit the nano editor by pressing the control key and the letter X together.
To activate the changes made to the bash_profile file, type:
Using Homebrew you can easily search, download, updat and remove open-source utilities, libraries etc that you need for your local development.
To search for any software package:
NOTE: Here name-of-the-package will be the name of the utility you want to search for.
To download and install the package:
To update the package:
To remove the package from your system:
Start using these command and your life will become so much easier. You can even look for software packages available with Homebrew on the Homebrew Formulae webpage.
Homebrew Wii
If you have Homebrew installed in your macOS and now want to remove it for some reason, you can easily uninstall it by running the following command,
Conclusion
How To Install Wine On Mac Using Homebrew Recipe
If you are a mac user, start using Homebrew, because its' easy to use, manages the complete lifecycle of installations(search, download, install, update and remove) and it is free to use. Share your experience of using Homebrew with us by commenting down below.