Homebrew installation got a little  twisted on MacBook M1

11/29/2022

 
Homebrew
I ran into some issues installing Homebrew on a new MacBook M1. Apple’s new silicon chipset requires some additional steps for many environments. 

Since Mac OS Catalina, Apple replaced the good old bash shell with zsh shell. 

On a new MacBook M1 running Ventura 13.0.1, I ran into some issues with Homebrew. After several different installation attempts, the solution below finally worked. I hope, this little blog post saves time for you.

First and foremost, make sure you install Xcode to set up the base environment. This xcode also ships the latest version of Git which saves you time and is accessible immediately from the command line.

xcode-select –install

Make sure you have a .zshrc file by running the 
ls -la command. This command will list out all your files and folders including the hidden ones. If you don’t find your .zshrc file you can create one by using the following command:

touch ~/.zshrc  

If you have one just ignore this step. 

Go to https://brew.sh and copy the following command under ‘Install Homebrew’

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 

At this step, you will see 3 commands suggested to be used in the command line. Copy, paste and run them one by one from your terminal.

echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/yoursuername/.zprofile

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/yourusername/.zprofile

eval "$(/opt/homebrew/bin/brew shellenv)"


Now go to the finder and open up your root directory. Use the shift+⌘+. to see all the hidden files. Open up from here the .zshrc and paste here the following path:

export PATH=/opt/homebrew/bin:$PATH

Make sure you save the .zshrc file. You can also do this via the command line, but for some reason, the path was not updated in my case so used this solution instead. 

Now close the terminal or use the source ~/.zshrc command to restart it. 

Run the command brew --version to see if all is installed.  It should return your current Homebrew version along with the latest homebrew git revision information.

Now you are ready to brew 🙂

    Archives

    November 2022

    Categories

    All
    Git
    Health
    Homebrew
    Social Media

Powered by Create your own unique website with customizable templates.
  • Home
  • Discover
  • Blog
  • Contact
  • Home
  • Discover
  • Blog
  • Contact