Skip to main content
9 of 19
added 120 characters in body
Tetsujin
  • 117.7k
  • 26
  • 201
  • 346

defaults delete is not working

I accidentally added a incorrectly formatted field in order to track automatic updates on my computer. When I try to run the command:
defaults delete /Library/Preferences/com.apple.SoftwareUpdate "^AutomaticCheckEnabled", it doesn't work.
The error is: Domain (/Library/Preferences/com.apple.SoftwareUpdate) not found. Defaults have not been changed.

Python Entries:
To create:
command = f"sudo defaults write {self.path} {self.key} -int {target}"
To delete:
command = f"defaults delete {self.path} {self.key}"

Output of default read /Library/Preferences/com.apple.SoftwareUpdate:

{
    AutomaticCheckEnabled = 1;
    LastAttemptBuildVersion = "13.4.1 (22F82)";
    LastAttemptSystemVersion = "13.4.1 (22F82)";
    LastBackgroundSuccessfulDate = "2023-07-24 13:19:33 +0000";
    LastFullSuccessfulDate = "2023-07-24 13:39:11 +0000";
    LastRecommendedMajorOSBundleIdentifier = "";
    LastRecommendedUpdatesAvailable = 1;
    LastResultCode = 2;
    LastSessionSuccessful = 1;
    LastSuccessfulDate = "2023-07-24 13:39:11 +0000";
    LastUpdatesAvailable = 1;
    PrimaryLanguages =     (
        "en-US",
        en
    );
    RecommendedUpdates =     (
                {
            "Display Name" = "macOS Security Response 13.4.1 (c)";
            "Display Version" = "13.4.1 (c)";
            Identifier = "MSU_UPDATE_22F770820d_patch_13.4.1_rsr";
            MobileSoftwareUpdate = 1;
            "Product Key" = "MSU_UPDATE_22F770820d_patch_13.4.1_rsr";
        }
    );
    SplatProductVersion = "macOS Security Response 13.4.1 (c) 13.4.1";
    TimeOfSemiSplatCompletion = "2023-07-24 13:22:41 +0000";
    "^AutomaticCheckEnabled" = 1;
}`