To enable unattended upgrades, you just need to install the package and most of the configurations should be done automatically.
$ apt install unattended-upgrades apt-listchanges -y
Once done, you need to enable the apt source list inside /etc/apt/apt.conf.d/50unattended-upgrades
under the following header:
Unattended-Upgrade::Origins-Pattern {
...
}
To activate unattended-upgrades, you need to ensure /etc/apt/apt.conf.d/20auto-upgrades
:
APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::Verbose "3";
Once done, you can run it manually to check its functionality is working fine by running the following command as root:
$ unattended-upgrade -d
The next thing is to ensure /etc/apt/listchanges.conf
has the following:
[apt]
frontend=pager
which=both
email_address=root
email_format=text
confirm=false
headers=false
reverse=false
save_seen=/var/lib/apt/listchanges.db
To enable notification when unattended upgrades is executed, you need to modify /etc/apt/apt.conf.d/50unattended-upgrades
and un-comment the following:
Unattended-Upgrade::Mail "root";
That's all for enabling unattended-upgrades.