0

While creating a Ubuntu VM in Azure with Packer, the installation process stops and hangs while configuring openssh-server. The command line prompts for you to select an option, and since this is an automatic build it just hangs until the process times out. How can I prevent this from happening?

    azure-arm.ubuntu: Configuring openssh-server
    azure-arm.ubuntu: --------------------------
    azure-arm.ubuntu:
    azure-arm.ubuntu: A new version (/tmp/fileu2AVnQ) of configuration file /etc/ssh/sshd_config is
    azure-arm.ubuntu: available, but the version installed currently has been locally modified.
    azure-arm.ubuntu:
    azure-arm.ubuntu:   1. install the package maintainer's version
    azure-arm.ubuntu:   2. keep the local version currently installed
    azure-arm.ubuntu:   3. show the differences between the versions
    azure-arm.ubuntu:   4. show a side-by-side difference between the versions
    azure-arm.ubuntu:   5. show a 3-way difference between available versions
    azure-arm.ubuntu:   6. do a 3-way merge between available versions
    azure-arm.ubuntu:   7. start a new shell to examine the situation
    azure-arm.ubuntu:
    azure-arm.ubuntu: What do you want to do about modified configuration file sshd_config?
KollKode
  • 101

1 Answers1

0

This error appears to be getting generated by the apt/apt-get update of the application as you are upgrading an instance of openssh server.

Looking at This post: https://www.mail-archive.com/debian-devel@lists.debian.org/msg249363.html

It would appear that the answer is to use something similar tot he below:

DEBIAN_FRONTEND=noninteractive \
        apt-get \
                -o Dpkg::Options::="--force-confnew" \
                --force-yes \
                -fuy \
                dist-upgrade

Alteratively, this post: automatic yes's to linux update/upgrade Suggests trying:

sudo DEBIAN_FRONTEND=noninteractive apt-get -yq upgrade
Fazer87
  • 12,965