Tutorial

New updates and improvements to Roundfleet.

Important notice

The code examples and scripts provided in these tutorials are for educational purposes only. Roundfleet is not responsible for any issues, damages, or security vulnerabilities that may arise from the use, modification, or implementation of these examples. Always review and test code in a secure environment before using it in production systems.

Disable Automatic macOS Updates

In enterprise environments, controlling when and how macOS updates are installed is crucial for maintaining system stability and ensuring compatibility with business applications. This tutorial shows how to disable automatic macOS updates using shell scripts.

Understanding macOS Update Settings

macOS has two main automatic update behaviors:

  • Automatic Download: Downloads updates in the background
  • Automatic Check: Periodically checks Apple's servers for new updates

Both can be controlled via the com.apple.SoftwareUpdate preference domain.

Basic Scripts

Disable Automatic Download

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

Disable Automatic Check

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

Enterprise Deployment Script

For large-scale deployment across your Roundfleet:

#!/bin/bash

# Disable Automatic macOS Updates - Enterprise Script
# Compatible with macOS 10.14+

# Function to log messages
log_message() {
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a /var/log/macos_update_config.log
}

# Function to get current user
get_current_user() {
    stat -f "%Su" /dev/console
}

# Main configuration function
configure_updates() {
    local current_user
    current_user=$(get_current_user)
    
    log_message "Starting macOS update configuration for user: $current_user"
    
    # Disable automatic download
    if defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -boolean false; then
        log_message "✓ Automatic download disabled successfully"
    else
        log_message "✗ Failed to disable automatic download"
        return 1
    fi
    
    # Disable automatic check
    if defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -boolean false; then
        log_message "✓ Automatic check disabled successfully"
    else
        log_message "✗ Failed to disable automatic check"
        return 1
    fi
    
    # Disable automatic installation (additional security)
    if defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -boolean false; then
        log_message "✓ Automatic installation disabled successfully"
    else
        log_message "✗ Failed to disable automatic installation"
    fi
    
    # Kill Software Update preferences to force reload
    killall -HUP cfprefsd 2>/dev/null || true
    
    log_message "macOS update configuration completed"
    return 0
}

# Verification function
verify_configuration() {
    local download_status check_status install_status
    
    download_status=$(defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload 2>/dev/null || echo "not set")
    check_status=$(defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled 2>/dev/null || echo "not set")
    install_status=$(defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates 2>/dev/null || echo "not set")
    
    log_message "Configuration verification:"
    log_message "  Automatic Download: $download_status"
    log_message "  Automatic Check: $check_status"
    log_message "  Automatic Install: $install_status"
}

# Execute main function
if configure_updates; then
    verify_configuration
    log_message "Script executed successfully"
    exit 0
else
    log_message "Script execution failed"
    exit 1
fi

Verification Script

Check current update settings:

#!/bin/bash

echo "=== macOS Update Settings Status ==="
echo "Automatic Download: $(defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload 2>/dev/null || echo 'Not configured')"
echo "Automatic Check: $(defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled 2>/dev/null || echo 'Not configured')"
echo "Automatic Install: $(defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates 2>/dev/null || echo 'Not configured')"

Re-enabling Updates

To restore automatic updates:

#!/bin/bash

# Re-enable automatic download
defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -boolean true

# Re-enable automatic check
defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -boolean true

# Re-enable automatic installation
defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -boolean true

echo "Automatic updates re-enabled"

Troubleshooting

IssueSolution
Settings revert after restartEnsure scripts run with admin privileges
System Preferences shows old valuesRestart System Preferences or run killall -HUP cfprefsd
Changes don't applyCheck /var/log/macos_update_config.log for errors
Updates still downloadVerify the preference file permissions

Important Notes

  • Users with admin privileges can manually change these settings
  • The System Preferences/Settings app may need to be restarted to reflect changes
  • Consider using Configuration Profiles for stricter enforcement
  • Test on a small group before enterprise-wide deployment

Configuration Profile Alternative

For stricter control, consider deploying a Configuration Profile instead:

<key>AutomaticCheckEnabled</key>
<false/>
<key>AutomaticDownload</key>
<false/>
<key>AutomaticallyInstallMacOSUpdates</key>
<false/>

Related Tutorials

Automatic App Launch Management on macOS

Deploy and manage automatic app launches on macOS devices using enterprise-grade LaunchAgent configurations, user profile management, and centralized application lifecycle control.

Jul 7, 2025

App Store Auto Updates Management on macOS

Learn how to control App Store automatic updates on macOS devices using command-line tools. Comprehensive guide for enterprise update management, bandwidth optimization, and security control.

Jul 7, 2025

Safari Browser Management on macOS

Learn how to configure Safari homepage, browser settings, security policies, and deploy enterprise browser management across your Roundfleet devices with comprehensive user management and compliance features.

Jul 7, 2025

Rosetta 2 and Apple Silicon Compatibility Management on macOS

Learn how to install, manage, and monitor Rosetta 2 translation layer on Apple Silicon Macs with enterprise-grade compatibility management, application monitoring, and fleet-wide deployment capabilities.

Jul 7, 2025

Package Management with Homebrew on macOS

Deploy, manage, and maintain software packages across macOS devices using Homebrew with enterprise-grade configuration management, compliance tracking, and automated deployment workflows.

Jul 7, 2025

Manage Kernel Extensions on macOS

Learn how to display, load, unload, and monitor kernel extensions (kexts) on macOS devices using command-line scripts for enhanced system management and security.

Jul 7, 2025

Apple ID Management and Identity Tracking on macOS

Discover and manage Apple IDs, monitor iCloud services, enforce privacy policies, and implement enterprise identity management across macOS devices with comprehensive audit and compliance tracking.

Jul 7, 2025

App Store Inventory Management on macOS

Learn how to discover, track, and manage App Store applications on macOS devices using comprehensive inventory scripts with enterprise reporting, compliance tracking, and fleet-wide app management capabilities.

Jul 7, 2025