Remove cloud-init from Ubuntu

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:

Remove cloud-init from Ubuntu - blackMORE Ops - 1

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.

Remove cloud-init from Ubuntu - blackMORE Ops - 2

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 :)

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading

Privacy Policy on Cookies Usage

Some services used in this site uses cookies to tailor user experience or to show ads.