Pages

Friday, April 14, 2023

Installing Brew in Mac

Homebrew is a free and open-source package manager for macOS that simplifies the process of installing, updating, and managing software packages on your Mac. It allows you to easily install and manage a wide range of software packages, libraries, and tools that are not included in macOS by default.
Homebrew uses a command-line interface to install packages and dependencies, which means that you can easily manage and customize your software installations using simple commands in the Terminal.
Some of the benefits of using Homebrew on your Mac include:
  • Easy installation of software packages and dependencies
  • Automatic updates of installed packages
  • Uninstallation of packages and dependencies
  • Ability to customize software installations with different options and versions
  • Access to a large and active community of developers who contribute to Homebrew's package repository
Following are commands to install the brew and add it to CLI.

xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 
Following will be at the end of the installation, Copy and run that in the Mac CLI. 
  (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/<Username>/.zprofile\n    eval "$(/opt/homebrew/bin/brew shellenv)"


xcode-select --install is a command that installs the command-line tools for Xcode on your Mac. Xcode is a development environment for macOS that provides tools for developing software for macOS, iOS, watchOS, and tvOS. The command-line tools for Xcode include a variety of tools and libraries that are necessary for building and compiling software on your Mac, even if you are not using Xcode itself.
Running xcode-select --install will open a dialog box that prompts you to install the command-line tools for Xcode. This may take a few minutes to complete, depending on your internet connection speed.

The command /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" installs Homebrew on your Mac. Homebrew is a package manager that allows you to easily install and manage software packages and libraries on your Mac.
The installation script for Homebrew will download and install the necessary files and dependencies for Homebrew, and will configure your system to use Homebrew as your default package manager.

The last command (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/<Username>/.zprofile\n eval "$(/opt/homebrew/bin/brew shellenv)" adds the necessary configuration to your .zprofile file to ensure that Homebrew is properly configured on your system. This command adds a line to your .zprofile file that tells your terminal to evaluate the output of the brew shellenv command, which sets up your environment variables to use Homebrew. This ensures that when you open a new terminal session, your system is properly configured to use Homebrew.

No comments:

Post a Comment