I recently discovered that a feature that I’ve always wanted in Ubuntu (and Debian) already exists, and has actually been available in past releases for years. By tweaking the settings in /etc/apt/apt-conf.d/10periodic and /etc/apt/apt.conf.d/50unattended-upgrades, you can enable periodic auto-updates and auto-cleaning of downloaded package files. Essentially something equivalent to running sudo apt-get update; sudo apt-get -y –force-yes upgrade; sudo apt-get autoclean in a cron job – except in a less hackish, more ‘distro official’ way. I’ve always felt this should be an Update Manager GUI option, maybe even default behavior.
It’s documented here on the Ubuntu wiki, but below is my regurgitation of that.
First, you need the unattended-upgrades package installed:
$ sudo apt-get install unattended-upgrades
Here’s the edits I made:
Run:
$ sudo gedit /etc/apt/apt.conf.d/10periodic
Edit the file to change:
APT::Periodic::Download-Upgradeable-Packages "0";APT::Periodic::AutocleanInterval "0";APT::Periodic::Unattended-Upgrade "0";
Then edit 50unattended-upgrades:
$ sudo gedit /etc/apt/apt.conf.d/50unattended-upgrades
Uncomment (remove the slashes):
// "${distro_id} ${distro_codename}-updates";
"${distro_id} ${distro_codename}-updates";
Save.
I have tried editing the files /etc/apt/apt.conf.d/10periodic and gedit /etc/apt/apt.conf.d/50unattended-upgrades and they do not exist. Have I done something wrong? I installed unattended-upgrades.
chkconfig unattended-upgrades on
i think that one should be also included