Installing Rosetta 2 on M1/M2 Mac

rishabhm
New Contributor

Hi Folks,

I need some assistance. I have been trying to onboard M1/M2 through prestage enrolment and it's failing due to rosetta2 not being available as some apps not getting installed properly. Can anyone suggest to me step by step process on how to install rosetta2 on those macs before any other application? 

 

Thanks,

Rish

1 ACCEPTED SOLUTION

Jason33
Contributor III

Set the first policy in your deployment to install Rosetta via Files and Processes/Execute Command: /usr/sbin/softwareupdate --install-rosetta --agree-to-license

View solution in original post

6 REPLIES 6

Jason33
Contributor III

Set the first policy in your deployment to install Rosetta via Files and Processes/Execute Command: /usr/sbin/softwareupdate --install-rosetta --agree-to-license

obi-k
Valued Contributor III

Like @Jason33 mentioned, and then scope it to your M1 Smart Group.

Screenshot 2023-01-09 at 8.38.20 AM.png

rishabhm
New Contributor

Thanks All, this works like a charm.

greatkemo
Contributor II

You can try this script if you have both Intel and Apple Silicon in your environment.

https://github.com/greatkemo/jamfPro/blob/master/macOS/Scripts/install_rosetta.sh 

SMR1
Contributor III

We're running the below command on our Mac's and didn't realize it wasn't installing until now. We use application that needs Rosetta to run. It seem really hit and miss, but we have a lot of devices missing our security application because of Rosetta.

#!/bin/bash
arch=$(/usr/bin/arch)
if [ "$arch" == "arm64" ]; then
echo "Apple Silicon - Installing Rosetta"
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
elif [ "$arch" == "i386" ]; then
echo "Intel - Skipping Rosetta"
else
echo "Unknown Architecture"
fi

 

Script we're running

Script result: Apple Silicon - Installing Rosetta
2023-06-06 10:49:57.031 softwareupdate[41105:168425] Package Authoring Error: 032-82191: Package reference com.apple.pkg.RosettaUpdateAuto is missing installKBytes attribute By using the agreetolicense option, you are agreeing that you have run this tool with the license only option and have read and agreed to the terms. If you do not agree, press CTRL-C and cancel this process immediately. Installing: 0.0% Installing: 0.0% Installing: 100.0% Installing: 100.0% Installing: -1.0% Installing: 89.1% Installing: 91.2% Installing: 91.8% Installing: 91.8% Installing: 100.0% Install of Rosetta 2 finished successfully

brayg
New Contributor III

Here's what I have been using. It seems to work reliably. It uses the brand_string, looking for the word "Apple" in the processor. I still get the missing installKBytes attribute but the installs are successful nonetheless. We originally used the example from Der Flounder but this version seems to run more quickly.

#!/bin/bash

# Determine the architecture of the macOS device
processorBrand=$(/usr/sbin/sysctl -n machdep.cpu.brand_string)
if [[ "${processorBrand}" = *"Apple"* ]]; then
 echo "Apple Processor is present."
else
 echo "Apple Processor is not present. Rosetta not required."
 exit 0
fi

# Check if Rosetta is installed
checkRosettaStatus=$(/bin/launchctl list | /usr/bin/grep "com.apple.oahd-root-helper")
RosettaFolder="/Library/Apple/usr/share/rosetta"
if [[ -e "${RosettaFolder}" && "${checkRosettaStatus}" != "" ]]; then
 echo "Rosetta Folder exists and Rosetta Service is running. Exiting..."
 exit 0
else
 echo "Rosetta Folder does not exist or Rosetta service is not running. Installing Rosetta..."
fi

# Install Rosetta
/usr/sbin/softwareupdate --install-rosetta --agree-to-license

# Check the result of Rosetta install command
if [[ $? -eq 0 ]]; then
 echo "Rosetta installed successfully."
 exit 0
else
 echo "Rosetta installation failed."
 exit 1
fi

exit 0


Should continue to work as long as Apple continues putting their name on their processors 😁