-
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
I have an 22.04.3 minimal-server vm.
I purged cloud-init, and did an autoremove afterwards.
Nothing bad happen. All works fine as before. netplan is still marked as automatic installed and active/working.
Only a few python3-packages are removed, as they are (correctly) not needed by an package anymore.
So, for my conclusion.
sudo touch /etc/cloud/cloud-init.disabled
is enough if you just don't need it, but doesn't care about some unused stuff left on disk.apt-get purge cloud-init
if you want to remove it.