Keep Ubuntu virtual machine up to date

For all the lazy programmers with running virtual machines in Ubuntu there is an easy way how to keep it up to date and well secured.

There is an awesome package unnattended-upgrades that installs all the updates you specified.

sudo apt-get install unattended-upgrades

The configuration is in /etc/apt/apt.conf.d/50unattended-upgrades and you can set it up to upgrade only the security vulnerabilities.

Unattended-Upgrade::Allowed-Origins {
 "${distro_id}:${distro_codename}-security";
  "Phusion:stable";
};

And to finish the configuration run the following command.

sudo dpkg-reconfigure --priority=low unattended-upgrades

Great solution for all the machines where you don’t want to be bothered. No excuses for security holes in a non-updated systems anymore.


Did you like the article? Send me a comment!