Category filter

Script to disable automatic download of OS updates on Mac

macOS devices can be configured to perform automatic checks for OS updates, ensuring that the latest OS updates from Apple are downloaded and installed seamlessly. To ensure compatibility of the software used by the organization with the new OS updates, administrators may prefer to verify them before updating the end-user devices. In such cases, the automatic download and installation of new OS updates can be disabled by executing scripts using the Execute Custom Script action.

Scripting language – Bash

File extension – .sh

Disclaimer:


The sample scripts provided below are adapted from third-party open-source sites.

Disable automatic download of OS updates

The ‘defaults write’ command uses the preference file ‘com.apple.SoftwareUpdate’ to specify the software update settings on the device. These settings let you specify whether to enable/disable automatic OS updates and check for new software updates.

The ‘AutomaticDownload’ key controls whether the automatic downloading of software updates should be enabled or disabled. Setting it to ‘-boolean false’ disables automatic downloads.

This will disable the automatic download of new OS updates. However, the user will still receive notifications in case new updates are available.

Automatic download of OS updates is disabled

Disable automatic check for OS updates

If you would like to prevent the device from automatically checking for new updates, you can deploy the following script.

The ‘AutomaticCheckEnabled’ key determines whether the device automatically checks for software updates. Setting it to ‘-boolean false’ disables automatic scans for new updates.

Automatic check for OS updates is disabled

If the System Preferences/Settings is kept open on the device when the script is executed from the portal, you may have to exit and open the System Preferences/Settings again for the script to take effect.

Notes:

  • End-user with admin privileges can still reconfigure these settings by navigating to System Preferences/Settings > Software Update.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository