1. Instale os pacotes necessários
apt-get install unattended-upgrades apt-listchanges
2. Edite o arquivo de configuração
Put the lines below into the configuration file /etc/apt/apt.conf.d/50unattended-upgrades, everything that was originally inside the generated file can be removed before you add the lines below.
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=TorProject";
};
Unattended-Upgrade::Package-Blacklist {
};
3. Reinício automático
If you want to automatically reboot add the following at the the end of the file /etc/apt/apt.conf.d/50unattended-upgrades
:
Unattended-Upgrade::Automatic-Reboot "true";
Atualize o arquivo /etc/apt/apt.conf.d/20auto-upgrades
com o seguinte conteúdo
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::AutocleanInterval "5";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::Verbose "1";
4. Teste
You can test your unattended-upgrades setup with the following command:
sudo unattended-upgrade -d