Ventura docs for M2 Macs in this comment: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd?permalink_comment_id=4555340#gistcomment-4555340
Old Monterey docs in this old revision: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd/32c410e3a1de73539c76fa13ea5486569c4e0c5d
Solution for Sonoma: https://gist.github.com/sghiassy/a3927405cf4ffe81242f4ecb01c382ac
successful upgrade to Sonoma, here are some experiences that I learn from these process. I hope it was helpful.
There are two main steps to do.
step 1: shield the host
1.open terminal and enable the root user and give it password.
2.enter the command below and press enter
"
sudo -i
echo "0.0.0.0 iprofiles.apple.com" >> /etc/hosts
echo "0.0.0.0 mdmenrollment.apple.com" >> /etc/hosts
echo "0.0.0.0 deviceenrollment.apple.com" >> /etc/hosts
echo "0.0.0.0 gdmf.apple.com" >> /etc/hosts
echo "0.0.0.0 acmdm.apple.com" >> /etc/hosts
echo "0.0.0.0 albert.apple.com" >> /etc/hosts
"
3.now you have successfully shield the host. if you do not wan to upgrade to Sonoma, then enjoy your macOS without annoying notifications. and if you want Sonoma, please follow the second step.
step 2: delete two files and built two files
1.shut down your Mac and enter Recovery.
2.in terminal on Recovery, enter "csrutil disable" to disable SIP.
3.reboot your Mac. in terminal on macOS.enter the command below and press enter.
"
sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
sudo launchctl disable system/com.apple.ManagedClient.enroll
"
finish! now you can enjoy the boring Sonoma.