disable apt-listchanges (and other interactive stuff) during upgrades (reliably)

All we need is an easy explanation of the problem, so here it is.

I have to admit, I really really hate apt-listchanges. If I’m going to do a huge dist-upgrade, I want to just leave the computer there for a few hours. The asker of this serverfault question had a similar goal in mind, bu after implementing all of the suggestions in that post, I was still hit by apt-listchanges.

Why is it so difficult to achieve non-interactivity with apt, an otherwise excellent program, given that the Unix philosophy aspires to it?

I am hoping the changes I made to /etc/apt/listchanges.conf will help, but I want suggestions as to how to reliably do upgrades without any interaction whatsoever.

[apt]
frontend=none
email_address=root
confirm=0
save_seen=/var/lib/apt/listchanges.db
which=news

This is the command I used was

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

I also added the following lines to /etc/dpkg/dpkg.cfg

force-confold
force-confdef

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

As you found and set in your config, apt-listchanges should not prompt if you set the frontend to none. You can also set the environment variable APT_LISTCHANGES_FRONTEND=none to achieve the same thing.

It sounds like what you really want to do is use the unattended-upgrades package. It handles everything for you: disabling apt-listchanges, setting the frontend to noninteractive, checking for and avoiding conffile prompts, etc. If nothing else, the contents of the Python script /usr/bin/unattended-upgrades should answer your questions about how it does its magic.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply