Sunday, January 9, 2022

How to install brew command-line utility in macOS

Requirement:

In order to install packages in macOS , we use "brew" command-line utility.

Installation Steps:

For installing "brew" utility follow below steps:

  1. (As a normal user) Download the install.sh script
    • curl -O https://raw.githubusercontent.com/Homebrew/install/master/install.sh
  2. (Provide execute permission to the downloaded script file install.sh)
    • chmod +x ./install.sh
  3. (Start the script execution)
    • ./install.sh
  4. (Add the default Homebrew install path to default .zprofile)
    • echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile

    • eval "$(/opt/homebrew/bin/brew shellenv)"
Finally execute the command brew help and test the installation

No comments:

Post a Comment