How to check if Rosetta2 is installed (macOS 11.5)

merlin
New Contributor II

Hi all,

after updating to the latest macOS 11.5 my current way to check if Rosetta2 is installed no longer works.

I used to check for:

/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist

But now that particular plist file doesn't exist anymore.

❯ ls -l /Library/Apple/System/Library/LaunchDaemons/
total 16
-rw-r--r--  1 root  wheel  606  1 Jan  2020 com.apple.MRTd.plist
-rw-r--r--  1 root  wheel  925  1 Jan  2020 com.apple.usbmuxd.plist

 

2 ACCEPTED SOLUTIONS

Ecco_Luke
New Contributor III

You can look at the policy logs for that script and it will tell you, but I appreciate that's not Smart Group-able like an EA is.

Of course, one way you'd know is to check the policy logs for an x86-compiled app PKG, as if Rosetta is missing the PKG will fail to install. 

Just thinking of ways for you to check that Apple can't change, like they have with the plist!

View solution in original post

MrRoboto
Contributor II

After macOS 11.5 we can no longer check for the com.apple.oahd.plist. Instead check if the oahd process is running.  

I'm still using the same EA and just updated a single line for the check...

# From this:
if [[ -f "/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist" ]]; then
# To this:
if /usr/bin/pgrep oahd >/dev/null 2>&1; then

View solution in original post

7 REPLIES 7

Ecco_Luke
New Contributor III

You can just reinstall it via Terminal, then you know it's done I suppose. We have a script that, amongst other things, queries the processor architecture and install it as the very first thing the Mac does, but that's only helpful on new builds. The command we use is as below:

 

softwareupdate --install-rosetta --agree-to-license

 

merlin
New Contributor II

Thanks, we already use that command to install Rosetta2.
But now I have no way to report/check if the installation went well nor if a machine is missing Rosetta2 altoghether.
We had an Extension Attribute for that, but since last macOS update, it no longer works.

Ecco_Luke
New Contributor III

You can look at the policy logs for that script and it will tell you, but I appreciate that's not Smart Group-able like an EA is.

Of course, one way you'd know is to check the policy logs for an x86-compiled app PKG, as if Rosetta is missing the PKG will fail to install. 

Just thinking of ways for you to check that Apple can't change, like they have with the plist!

View solution in original post

merlin
New Contributor II

Interesting, yes. I could check for a "dummy" x86 pkg failed install.
Thanks for the advice, I'll start testing this theory.

best

Ecco_Luke
New Contributor III

It's the way we do it mate. I try and have as few EAs as possible ideally.

ssmurphy
New Contributor III

I am using the following as an extension Attribute.

Its a mashup of an original EA that was working before the macOS 11.5.0 update and a script from https://github.com/rtrouton/rtrouton_scripts/blob/main/rtrouton_scripts/install_rosetta_on_apple_sil... by the always helpful @rtrouton 

 

#!/bin/bash

: << DOC
EA to determine whether Rosetta is installed.
Possible results:
"installed" - arm64 Mac - Rosetta is installed
"missing" - arm64 Mac - Rosetta is not installed
"ineligible" - Intel Mac - Rosetta cannot be installed
DOC

# is this an ARM Mac?
arch=$(/usr/bin/arch)
if [ "$arch" == "arm64" ]; then
# is rosetta 2 installed?
if /usr/bin/pgrep oahd >/dev/null 2>&1; then
result="installed"
else
result="missing"
fi
else
result="ineligible"
fi

echo "<result>$result</result>"

MrRoboto
Contributor II

After macOS 11.5 we can no longer check for the com.apple.oahd.plist. Instead check if the oahd process is running.  

I'm still using the same EA and just updated a single line for the check...

# From this:
if [[ -f "/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist" ]]; then
# To this:
if /usr/bin/pgrep oahd >/dev/null 2>&1; then

View solution in original post