D. Heinrich
Mar 9, 2022

Debian Setup automatic-updates

The purpose of unattended-upgrades is to keep the computer current with the latest security (and other) updates automatically.

Install the required package:

sudo apt install unattended-upgrades

Edit:

sudo vim /etc/apt/apt.conf.d/50unattended-upgrades

With the following content:

Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename}-updates";
"origin=Debian,codename=${distro_codename}-proposed-updates";
"origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
"o=Debian,a=stable";
"o=Debian,a=stable-updates";
"o=Debian,a=proposed-updates";
"o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
};
Unattended-Upgrade::Package-Blacklist {
};
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";

To enable add/edit the following file as well:

sud ovim /etc/apt/apt.conf.d/20auto-upgrades

With the following content:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";

Enable and/or restart the service:

sudo systemctl enable unattended-upgrades
sudo systemctl restart unattended-upgrades

Test your setup

sudo unattended-upgrades --dry-run --debug

Sources:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

D. Heinrich
D. Heinrich

Written by D. Heinrich

Working as a Head of Infrastructure at Flower Labs.

No responses yet

Write a response