I have a working cloud-init that is deployed using packer. Once the VM is booted and the autoinstall is completed, Ubuntu does the auto update thing. This seems to take forever to complete and is an unneeded step since we hand over to puppet after install.
At the moment, I pass incorrect DNS details to avoid the auto-update.
How can I disable that auto-update ?
Thanks !
You can't disable it, so you're stuck with using a clever work-around. I'd be tempted to use
cloud-init
to patch the subiquity code to skip the step.From a developer
https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/226
edit
I worked out a couple of methods to effectively skip the updates at the end of an autoinstall, but I have only tested with the 22.04 installer. I shared my methods at https://askubuntu.com/a/1410679/376778
Not sure whether this is helpful, but I had a similar problem when setting up new VPS instances for Vultr. The default cloud.ini configuration for Ubuntu servers on Vultr runs "apt-get update && apt-get upgrade" on the first boot. This was causing real problems with my setup scripts, which had trouble dealing with upgrades happening in the background. As a result, I looked all over the Internet to find a way to shut down automatic upgrades on first boot of my VPS (and ran into this page several times), but did not find anything directly on point.
Ultimately, I figured out that the "user-data" feature of cloud.ini can be used to override the cloud.ini setup defaults, and I thought I would share my experience.
I set the contents of user-data to the following:
Vultr requires this to be passed to the Vultr API as a base64 one-liner, which comes out as follows:
This worked for setting up a new Ubuntu 20.04 VPS on Vultr. Vultr no longer automatically runs updates or upgrades on first boot (allowing me to fine-tune how this is handled in my setup process). For a stand-alone computer (e.g., a Raspberry Pi at home), it looks like the following website might explain how to inject a user-data file into a setup process that relies on an ISO: https://www.pugetsystems.com/labs/hpc/How-To-Make-Ubuntu-Autoinstall-ISO-with-Cloud-init-2213/. However, I have not actually tried that myself, so your mileage may vary.