A while back, I wrote a post on how to enable automatic OS X updates on OS X Yosemite. The methods used to enable automatic macOS updates changed as of macOS Mojave, so let’s take a look at the changes. For more details, please see below the jump.
The main change is that the option to enable automatic macOS updates has moved from the com.apple.commerce preference domain to the com.apple.SoftwareUpdate preference domain. On OS X Yosemite through macOS High Sierra, the following command can be run with root privileges to enable OS X and macOS updates to be installed automatically:
defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true
When this command is run, the following checkbox should be checked in the App Store preferences in System Preferences.
For Yosemite and El Capitan:
- Install OS X updates
For Sierra and High Sierra:
- Install macOS updates
As of macOS Mojave, the following command can be run with root privileges to enable macOS updates to be installed automatically:
defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -bool true
When this command is run, the following checkbox should be checked in the Software Update preferences in System Preferences.
- Install macOS updates
In both cases, the Mac will check for new updates overnight and install them when the Mac is idle. If a reboot is needed as part of installing an update, the Mac will reboot automatically.
If the Mac is not idle and a reboot is needed, a notification will appear to the logged-in user asking permission to reboot.
On OS X Yosemite through macOS High Sierra, the notification should look similar to this:
On macOS Mojave, the notification should look similar to this:
Unfortunately, it is not yet possible to set these automatic update settings using a profile. The com.apple.commerce preference domain can’t be managed by a profile and the AutomaticallyInstallMacOSUpdates setting in the com.apple.SoftwareUpdate preference domain should be manageable with a profile, but for unknown reasons, it can’t be.
In place of a profile, I’ve written a script to set up automatic OS X / macOS updates for OS X Yosemite through macOS Mojave. This script enables the following options:
- Automatic background check for macOS software updates
- Automatic download of macOS software updates
- Automatic download and installation of XProtect, MRT and Gatekeeper updates
- Automatic download and installation of automatic security updates
- Automatic installation of OS X / macOS updates for OS X Yosemite through macOS Mojave
The script is available below and also on GitHub at the following address: