I'm running a tiny script to update and upgrade some Debian machines but since some weeks it always stopped due to some "news" the terminal is showing up. When manually upgrading I see a "fullscreen" (find screenshot below) from some software, which forces to press "q". I don't want to change any software so I'd like to find a solution, which allows to just skip every interactive screen, while upgrading.
Usually I was fine using:
sudo apt-get update -y sudo apt-get upgrade -y
After I realised that the upgrade process is interrupted without any timeout, I also tried to use the solution of this post:
sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade
but unfortunately with the same result. Does anybody have a solution to just upgrade a machine without any interruptions?
First I just executed:
Secondary edited the /etc/dpkg/dpkg.cfg file to:
# dpkg configuration file # # This file can contain default options for dpkg. All command-line # options are allowed. Values can be specified by putting them after # the option, separated by whitespace and/or an `=' sign. # # Do not enable debsig-verify by default; since the distribution is not using # embedded signatures, debsig-verify would reject all packages. no-debsig # Log status changes and actions to a file. log /var/log/dpkg.log force-confold force-confdef
Finally I executed:
sudo apt-get upgrade -yq
This did the trick regarding "press q to quit" - great!
I think it's also working to combine the commands executing:
DEBIAN_FRONTEND=noninteractive sudo apt-get -o Dpkg::Options::="--force-confnew --force-confdef" --force-yes -yq upgrade
Unfortunately another similar problem shows up now:
Also trying to edit /etc/apt/listchanges.conf didn't work out unfortunately:
[apt] frontend=none email_address=root confirm=0 save_seen=/var/lib/apt/listchanges.db which=news
I noticed (sorry if this is obvious for an advanced linux user) that bash acts different, when you execute a command via script than directly entering the command into the console.
All in all it was enough for my script solution to add the -yp parameter and set the DEBIAN_FRONTEND. In order to be safe, I'd edit the /etc/dpkg/dpkg.cfg file too.
#!/bin/bash DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND apt-get -yq update apt-get -yq upgrade