-
Create an empty file to prevent the service from starting
sudo touch /etc/cloud/cloud-init.disabled
-
Disable all services (uncheck everything except "None"):
sudo dpkg-reconfigure cloud-init
-
Uninstall the package and delete the folders
sudo dpkg-reconfigure cloud-init sudo apt-get purge cloud-init sudo rm -rf /etc/cloud/ && sudo rm -rf /var/lib/cloud/
-
Restart the computer
sudo reboot
While it does leave netplan.io and some other rather necessary things alone if you EVER run 'sudo apt autoremove' for any reason in the future you will cripple the install. Hope you have physical access or IPMI to fix it at that point.
Because of this I would never run anything more than 'sudo touch /etc/cloud/cloud-init.disabled'.
Really stupid move on Ubuntu's part to tie things in like this for a service not everyone is going to use. I hate opt-out with the fury of 9001 dying suns.