# 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](https://www.hexnode.com/mobile-device-management/help/how-to-run-scripts-on-mac-using-hexnode-mdm/) 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
----------------------------------------

Script to disable automatic download of OS updates on macOS devices

\#!/bin/bash defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -boolean false

   1

2

  \#!/bin/bash 

defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -boolean false

   

 

  

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](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2023/06/Disable-automatic-download-of-OS-updates.png "Disable automatic download of OS updates")](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2023/06/Disable-automatic-download-of-OS-updates.png)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.

Script to disable check for OS updates on macOS devices

\#!/bin/bash defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -boolean false

   1

2

  \#!/bin/bash 

defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -boolean false

   

 

  

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](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2023/06/Disable-automatic-check-for-OS-updates.png "Disable automatic check for OS updates")](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2023/06/Disable-automatic-check-for-OS-updates.png)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.