Last active
January 17, 2022 23:52
-
-
Save andrewfraley/e924e09b64def7dca1bde6de53cc22cf to your computer and use it in GitHub Desktop.
Used to do final cleanup on a Ubuntu 20.04 image template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apply updates and clear apt cache | |
echo "Applying updates and clearing apt cache" | |
apt update && apt -y upgrade && apt -y autoremove && apt clean | |
# Clear this to regen this file (you can't delete it). Otherwise DHCP will give the same IP to every system built with this | |
echo "Clearing /etc/machine-id" | |
truncate -s0 /etc/machine-id | |
echo "Running cloud-init clean" | |
cloud-init clean | |
echo "Shutting down!" | |
shutdown -h "now" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment