-
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
After purged cloud-init (on 22.04), the netplan package is also removed.
I followed this section 3.3. Temporary Static IP via ip
to temporary get an IP address, then reinstall netplan using: sudo apt install netplan.io