Disable cloud-init on Ubuntu

This step-by-step tutorial will guide you on how to remove cloud-init and unattended-upgrades from your Ubuntu system. cloud-init is the Ubuntu package that handles early initialization of a cloud instance. unattended-upgrades allows installation of security upgrades automatically.

If you no longer need cloud-init and unattended-upgrades, here is how to remove them and ensure your instance is in a desired state.

Step 1: Remove cloud-init

First, we need to purg cloud-init. Purging will not only remove the package but also the config files. Enter the following command in your terminal:

sudo apt purge cloud-init

Step 2: Remove cloud-init Configuration Files

Now, let's remove the remaining cloud-init configuration files to prevent the system from referencing them in the future.

sudo rm -rvf /etc/cloud

Step 3: Remove unattended-upgrades

To remove unattended-upgrades, input the following command:

sudo apt purge unattended-upgrades

Step 4: Remove unattended-upgrades Logs

Next, we want to remove the log files generated by unattended-upgrades:

sudo rm -rvf /var/log/unattended-upgrades

Step 5: Remove Unnecessary Packages

Now, we will use autoremove option to remove packages that were automatically installed to satisfy dependencies for other packages and now are no longer needed:

sudo apt autoremove

Step 6: Install netplan.io

Running the following command will install netplan.io, a network configuration utility:

sudo apt install netplan.io

Step 7: Install isc-dhcp-client

Finally, we'll need to install isc-dhcp-client, which is a DHCP client used to automatically obtain and update IP addresses:

sudo apt install isc-dhcp-client

Now, you have successfully removed cloud-init and unattended-upgrades from your Ubuntu system. Please feel free to revisit this guide whenever you need assistance.

results matching ""

    No results matching ""