3

I have an Ubuntu 12.04.5 LTS created in Azure Cloud. I create it from a Jenkins powershell build that: 1. Create VM in Azure 2. Execute some remote SSH commands (among them apt-get dist-upgrade) 3. Create a Virtual Image from VM

But the build hangs in Step 2.In step 2, among other commands, I execute:

apt-get update
apt-get -q -y dist-upgrade

The intention of -y is to avoid interactive questions. If I run manually from a shell apt-get -q -y dist-upgrade it works fine until twice it gets stuck:

First interactive question: enter image description here

Second interactive question: enter image description here

Parameter -y is supposed to avoid this situation. As you can see the offending package is waagent, that is Microsoft Azure Linux Agent and it comes installed by default when I finish step 1

My question is: How can I avoid these interactive questions? (either answering Yes, or No, or avoiding to upgrade this package or something else)

2 Answers2

0

May be you can also try:

DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes
-1

Seems that clashes with config files are pretty common in apt-get (dkpg) I solve the problem by using:

apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade

The options mean:

  • --force-confdef: Ask dpkg to decide alone when it can and prompt otherwise...
  • --force-confold: Do not modify the current configuration file...