Cloud images are operating system templates and every instance starts out as an identical clone of every other instance. It is the user data that gives every cloud instance its personality and cloud-init is the tool that applies user data to your instances automatically. Cloud-init is the defacto multi-distribution package that handles early initialization of a cloud instance. However, it’s not required for installation where you are not going to leverage it’s capabilities or you are not going to use it at all cause there’s simply no internet connectivity to that system. Also cloud-init contributes to long boot times and confusing output on the terminal. For people like who likes to have their system boot up super fast and just do something, it’s possibly best to simply remove cloud-init. Following instructions are simple enough and works every time:
Wait for VM to boot and then login. If you’re sudo user, then you can simply sudo yourself. Issue the following command to clean 90_dpkg.cfg file config (set to None).
echo 'datasource_list: [ None ]' | sudo -s tee /etc/cloud/cloud.cfg.d/90_dpkg.cfg
Once done, then you can purge cloud-init. After purge simply remove the cloud-init folders and reboot.
Just purge cloud-init, delete folders and reboot.
sudo apt-get purge cloud-init - y sudo rm -rf /etc/cloud && sudo rm -rf /var/lib/cloud/ sudo reboot
That’s it, simplest way to remove cloud-init from Ubuntu :)