Automatic apt-ing in Debian

Recently I wanted to schedule some routine apt operations on our server. I discovered there is already an “apt” entry in /etc/cron.daily, but sadly it seemed that the documentation on how to configure it was less clear than it should have been. Hopefully this will aide another Debian user in the future!

In /etc/apt/apt.conf
# Perform a daily apt-get update
APT::Periodic::Update-Package-Lists 1;
# Download any upgradeable packages
APT::Periodic::Download-Upgradeable-Packages 1;
# Run apt-get autoclean every 7 days
APT::Periodic::AutocleanInterval 7;