Ubuntu 22.04 — Remove cloud-init

Jbn1233
Dec 23, 2023

Just make it more simple and noninteractive.

#!/bin/bash

export DEBIAN_FRONTEND=noninteractive

touch /etc/cloud/cloud-init.disabled
dpkg-reconfigure cloud-init
dpkg-reconfigure cloud-init
apt-get purge --assume-yes cloud-init
rm -rf /etc/cloud/ && rm -rf /var/lib/cloud/
reboot

That’s all.

refer: https://gist.github.com/zoilomora/f862f76335f5f53644a1b8e55fe98320

--

--

Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |