NB! command-R is replaced with holding the power button on M1 macs.
a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS
b. Initial installation will run for approximately 1 hour, and reboot once
c. It will then show a remaining time of about 10-15 minutes
d. When it reboots again, be sure to press command-R to boot into recovery and continue with Main procedure
Boot to Recovery Mode by holding command-R during restart and continue with Main procedure
- Open Utilities → Terminal and type
$ csrutil disable
$ reboot
-
Hold
command-Rduring the reboot to enter Recovery Mode again -
Enter Disk Utility, and mount the
Macintosh HDvolume (or whatever your main volume is named). (It might already be mounted.) -
Exit Disk Utility, open Utilities → Terminal, and type
$ cd "/Volumes/Macintosh HD/System/Library"
$ cd ../../etc
$ echo "0.0.0.0 iprofiles.apple.com" >> hosts
$ echo "0.0.0.0 mdmenrollment.apple.com" >> hosts
$ echo "0.0.0.0 deviceenrollment.apple.com" >> hosts
$ echo "0.0.0.0 gdmf.apple.com" >> hosts
$ csrutil enable
$ reboot
-
If you come to the “Choose your country/location” dialogue, make sure to not select a wireless network, but “continue without an internet connection”
-
After a normal boot, you can verify the DEP status in Terminal:
$ profiles status -type enrollment
Enrolled via DEP: No
MDM enrollment: No









Ok so I tried to update straight from 13.7 to 15 in software update but it failed then update showed up Sonoma (14.7)
so I made sure my hosts were set blocking the usual suspects
went into my router (lynksis) and opened up parental controls found my mac in devices and blocked access to the same as hosts file.
then just updated to sonoma took a while but at went ok mac is working as normal no MDM or difference to previous.
Now the update to 15 has showed up in update so I've now installed the update to 15 no issues at all no MDM pop ups everything seems to be working as it should , Hosts file remains unchanged still blocking as it should.
TLDR; I just made sure my hosts file and router was blocking deviceenrollment.apple.com, mdmenrollment.apple.com, iprofiles.apple.com and just updated as normal. 13 - 14 - 15
thanks.