This steps were generated while using Ubuntu 20.04.
Install unattended-upgrades
You will need unintended-upgrades
installed.
$ sudo apt update
$ sudo apt install unattended-upgrades
Create (or modify existing) configuration file
Depending on your situation, you might find that you do not want automatic upgrades on certain installations.
In such case, modify the following configuration file to blacklist by listing out applications you do not want automatic upgrades.
File: /etc/apt/atp.conf.d/50unattended-upgrades
Unattended-Upgrade::Package-Blacklist {
"vim";
"nginx";
"mariadb-server";
};
Enable the automatic upgrade
You can do this using an interactive dialog by running the following command
sudo dpkg-reconfigure --priority=low unattended-upgrades
It will create a configuration file with your applied settings. An example of this file is shown below.
File: /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::Download-Upgradeable-Packages "1";
View the /etc/cron.daily/apt
in the header section for more information about the availble settings.