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)


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...
  • Wish downvoters would state what's wrong; works for me! – TJ Biddle Jun 6 '18 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.