Setting up unattended upgrades for security on Debian

With the recent spate of vulnerabilities in popular Linux packages, I figured it was time to enable automatic updating of packages to ensure my servers are secure, even when I’m not there to manually update them. On Debian, setting up unattended upgrades is trivial.

The following commands need to be run with escalated privileges: sudo or root.

apt-get install unattended-upgrades
dpkg-reconfigure unattended-upgrades

Select yes after the last command and your system should now automatically upgrade to the latest packages (and hopefully be a bit more secure).

There are more advanced configurations and options to exclude certain packages from automatically updating. I recommend looking here and here if that suits your use case.

Leave a Reply

Your email address will not be published. Required fields are marked *