Skip to content

Instantly share code, notes, and snippets.

@brandonb927
Created March 23, 2021 16:36
Show Gist options
  • Save brandonb927/10495ef6abe0cd47b5793e79fdbabb2c to your computer and use it in GitHub Desktop.
Save brandonb927/10495ef6abe0cd47b5793e79fdbabb2c to your computer and use it in GitHub Desktop.
A "truly noninteractive" Ubuntu-based Packer HCL template for dist-upgrade
build {
# ...
provisioner "shell" {
inline = [
"echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections",
"sudo apt-get update",
"sudo apt-get dist-upgrade -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef -y --allow-downgrades --allow-remove-essential --allow-change-held-packages",
"sudo apt-get autoremove -y",
"sudo apt-get clean",
]
}
# ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment