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 -yOnce 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 -dThe next thing is to ensure /etc/apt/listchanges.conf has the following:
[apt]frontend=pagerwhich=bothemail_address=rootemail_format=textconfirm=falseheaders=falsereverse=falsesave_seen=/var/lib/apt/listchanges.dbTo 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.