Take a look

Tech

How to install Mongodb on Apple M1 chip, Apple silicons, Enable rosetta terminal in mac M1 silicon.

As you know mac is now running with apple silicon and its success in the market shows the potential of many generations of apple silicons. There are some design changes that Apple has made with macOS Big Sur which affects the existing environments. At this time, macOS Big Sur does not install rosetta2 by default on Apple Silicon Macs. Rosetta 2 is Apple’s software for aiding in the transition from Macs running on Intel processors to Macs running on Apple Silicon processors. It allows most Intel apps to run on Apple Silicon without issues, which provides time for vendors to update their software to a Universal build which can run on both Intel and Apple Silicon. 

In 2020, Apple announced Rosetta 2 would be bundled with macOS Big Sur, to aid in theMac transition to Apple silicon. The software permits many applications compiled exclusively for execution on x86-64-based processors to be translated for execution on Apple silicon.

In addition to the just-in-time (JIT) translation support, Rosetta 2 offers ahead-of-time compilation (AOT), with the x86-64 code fully translated, just once, when an application without a universal binary is installed on an Apple silicon Mac. Without rosetta2 installed intel apps say mongodb does not run on apple silicon. Follow the below steps if you need to install rosetta2 in your mac

You can install Rosetta 2 on Apple Silicon Macs using the softwareupdate command. To install Rosetta 2, run the following command with root privileges:

/usr/sbin/softwareupdate --install-rosetta

Installing this way will cause an interactive prompt to appear, asking you to agree to the Rosetta 2 license. If you want to perform a non-interactive install, please run the following command with root privileges to install Rosetta 2 and agree to the license in advance:


/usr/sbin/softwareupdate --install-rosetta --agree-to-license

Next thing is to install homebrew which is a package manager for mac, it is a free and open-source software package management system that simplifies the installation of software on Apple’s operating system macOS as well as Linux.

You must run the homebrew install command from the terminal under rosetta for that quit the terminal, find the terminal app in the finder and command+click on the terminal app. Now Right click on the terminal and click on get info. Select the rosetta2 checkbox.

Now the run the following command to install homebrew

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

After successful installation 

To Install mongo execute the below commands

brew tap mongodb/brew brew install mongodb-community@4.4

To run mongo as a macOS service execute the command –

brew services start mongodb-community@4.4

Please follow the mongodb official installation document for more details

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

Leave a Reply