According to the cloud-init docs the way to disable it is:

sudo touch /etc/cloud/cloud-init.disabled

And/or set cloud-init=disabled on the kernel command line if it's enabled that way.


This worked for me in Ubuntu Server 18.04.1 LST

  1. $ echo 'datasource_list: [ None ]' | sudo -s tee /etc/cloud/cloud.cfg.d/90_dpkg.cfg

  2. $ sudo apt-get purge cloud-init

  3. $ sudo rm -rf /etc/cloud/; sudo rm -rf /var/lib/cloud/

  4. $ reboot

Good Luck.