Following the Debian wiki documentation and this answer I have successfully set up unattended upgrades. I have confirmed that upgrades are really run.
However, I want to avoid eventually getting disk space problems, so I want to make sure that apt clean
is also run regularly.
The Debian documentation seems to imply that I need create a file at /etc/apt/apt.conf.d/02periodic
and add something like this to it
APT::Periodic::AutocleanInterval "21";
But I haven't needed any of the other settings suggested for that file (such as APT::Periodic::Enable "1"
).
I find the wiki page really confusing. It suggests two completely different ways of configuring when to run unattended upgrades: Automatic call via /etc/apt/apt.conf.d/02periodic and Modifying download and upgrade schedules (on systemd), but gives no indication when or why you would use one or the other. I've used the latter way, since that seemed simplest.
/lib/systemd/system/apt-daily-upgrade.timer
(which is definitely run) clearly states
Description=Daily apt upgrade and clean activities
Note the and clean
.
So, will I get automatic apt clean
without creating a 02periodic
, or not?
echo 'APT::Periodic::AutocleanInterval "7";' | sudo tee -a /etc/apt/apt.conf.d/20auto-upgrades
– Klas Mellbourn Apr 20 '19 at 09:59