Showing posts with label mac-os. Show all posts
Showing posts with label mac-os. Show all posts

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

Sunday, December 26, 2021

How to make a user part of group in macOS Big Sur 11.6

Scenario: You are using the MacBook (with macOS Big Sur 11.6) for the first time and you wanted to install "brew" (or) "wget" (or) any other command-line utility

Let's consider user name is "webuser" and you wanted to make this user part of a "wheel" group to execute sudo commands. Use the command "dseditgroup"

$ (Run the command as root user in macOS)

$ dseditgroup -o edit -a webuser -t user wheel

o: Operation - read, create, edit, delete , checknumber 

a: Name of the record to be added to the group specified by group name

t: Type of record to be added to or deleted from group specified by groupname. Valid values are user, computer , group or computergroup

wheel: groupname