0

I've a CIS Ubuntu 22.04 LTS base image from AWS, which I'm attempting to use Packer to burn myself a base image from.

As this is a fully non-interactive pipeline, I cannot have any tty issues and the build is failing. I've researched this for a long time now, and I'm out of ideas:

DEBIAN_FRONTEND=noninteractive sudo apt-get \
  -o Dpkg::Options::=--force-confold \
  -o Dpkg::Options::=--force-confdef \
  -y --allow-downgrades --allow-remove-essential \
  --allow-change-held-packages dist-upgrade

should work but still dumps me at the same menu found in this question.

The only suspicions I have at the moment are

  • /tmp is noexec which might affect libc6 updates - but this shouldn't result in the problem experienced
  • Some other CIS-related preparation may have been applied to the source marketplace image which I'm not aware of.

What can I do to force this machine to dist-upgrade non-interactively with the old/default configs of files encountered?

I note this on attempt:

Can't exec "/tmp/libc6.config.uLjYjf": Permission denied at /usr/lib/aarch64-linux-gnu/perl-base/IPC/Open3.pm line 178.

which I cannot do much about.

I also found this answer but when I run

debconf-set-selections <<< "grub-efi grub-efi/install_devices multiselect /dev/sda1"
debconf-set-selections <<< "kdump-tools kdump-tools/install_kdump boolean true"
DEBIAN_FRONTEND=noninteractive sudo apt-get -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef -y dist-upgrade

I still get the menu up.

volvox
  • 121

1 Answers1

1

By default, sudo sanitizes the environment of the command it runs. So instead of DEBIAN_FRONTEND=noninteractive sudo apt-get ..., try sudo DEBIAN_FRONTEND=noninteractive apt-get ....

nturner
  • 111