Ubuntu server – zapnutí automatických aktualizací
There is a package that can be used to do this for you. Linky
sudo apt-get install unattended-upgrades
That is the package you need to install. Once its installed edit the file
/etc/apt/apt.conf.d/10periodic
In that file you can set how often you want the server to update.
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::AutocleanInterval "7"; APT::Periodic::Unattended-Upgrade "1";
The file should look like that. The 1 means it will update every day. 7 is weekly.
/etc/apt/apt.conf.d/50unattended-upgrades
This file will let you chose what updates you want to make by choosing where apt can search for new updates and upgrades. ( My personal opinion on this is I would set it to security if this is a server )
Unattended-Upgrade::Allowed-Origins { "Ubuntu lucid-security"; // "Ubuntu lucid-updates"; };
Your file will look like this obviously this is for 10.04 so you will need to change the file sources to precise but the same functionality is there. I would remove the updates one and just leave security.
This is the link above condensed into a smaller package with my thoughts.