Created
February 15, 2026 18:21
-
-
Save htlin222/c27e562557391cd14810e7d16fd6cc7f to your computer and use it in GitHub Desktop.
Remove Microsoft AutoUpdate from macOS | curl -fsSL https://gist.githubusercontent.com/htlin222/c27e562557391cd14810e7d16fd6cc7f/raw/remove-microsoft-autoupdate.sh | bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Remove Microsoft AutoUpdate from macOS | |
| # Usage: curl -fsSL https://gist.githubusercontent.com/htlin222/RAW_URL | bash | |
| set -euo pipefail | |
| echo "🧹 Removing Microsoft AutoUpdate from macOS..." | |
| # Step 1: Kill running processes | |
| echo "[1/6] Killing running processes..." | |
| pkill -9 -f "Microsoft AutoUpdate" 2>/dev/null || true | |
| pkill -9 -f "Microsoft AU" 2>/dev/null || true | |
| # Step 2: Unload launch agents | |
| echo "[2/6] Unloading launch agents..." | |
| launchctl bootout gui/$(id -u) com.microsoft.update.agent 2>/dev/null || true | |
| launchctl bootout gui/$(id -u) com.microsoft.SyncReporter 2>/dev/null || true | |
| launchctl bootout gui/$(id -u) com.microsoft.OneDriveStandaloneUpdater 2>/dev/null || true | |
| launchctl remove com.microsoft.update.agent 2>/dev/null || true | |
| launchctl remove com.microsoft.SyncReporter 2>/dev/null || true | |
| launchctl remove com.microsoft.OneDriveStandaloneUpdater 2>/dev/null || true | |
| # Step 3: Remove launch agent/daemon plist files | |
| echo "[3/6] Removing launch agent plist files..." | |
| rm -f ~/Library/LaunchAgents/com.microsoft.update.agent.plist 2>/dev/null || true | |
| rm -f ~/Library/LaunchAgents/com.microsoft.autoupdate*.plist 2>/dev/null || true | |
| sudo rm -f /Library/LaunchAgents/com.microsoft.update.agent.plist 2>/dev/null || true | |
| sudo rm -f /Library/LaunchDaemons/com.microsoft.autoupdate*.plist 2>/dev/null || true | |
| # Step 4: Remove the application | |
| echo "[4/6] Removing MAU2.0 application..." | |
| sudo rm -rf "/Library/Application Support/Microsoft/MAU2.0" 2>/dev/null || true | |
| # Step 5: Clean up preferences and caches | |
| echo "[5/6] Cleaning up preferences and caches..." | |
| rm -rf ~/Library/Preferences/com.microsoft.autoupdate*.plist 2>/dev/null || true | |
| rm -rf ~/Library/Caches/com.microsoft.autoupdate* 2>/dev/null || true | |
| rm -rf ~/Library/Logs/Microsoft/autoupdate* 2>/dev/null || true | |
| # Step 6: Prevent reinstallation | |
| echo "[6/6] Setting autoupdate to manual..." | |
| defaults write com.microsoft.autoupdate2 HowToCheck -string 'Manual' | |
| # Verify | |
| echo "" | |
| echo "=== Verification ===" | |
| if pgrep -fl "Microsoft" | grep -qi update 2>/dev/null; then | |
| echo "⚠️ Some Microsoft Update processes still running" | |
| else | |
| echo "✅ No Microsoft Update processes running" | |
| fi | |
| if launchctl list 2>/dev/null | grep -qi microsoft; then | |
| echo "⚠️ Some Microsoft launch agents still loaded" | |
| else | |
| echo "✅ No Microsoft launch agents loaded" | |
| fi | |
| if [ -d "/Library/Application Support/Microsoft/MAU2.0" ]; then | |
| echo "⚠️ MAU2.0 directory still exists (may need manual sudo removal)" | |
| else | |
| echo "✅ MAU2.0 directory removed" | |
| fi | |
| echo "" | |
| echo "🎉 Microsoft AutoUpdate removal complete!" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -fsSL https://gist.githubusercontent.com/htlin222/RAW_URL | bash