Unattended upgrades

Installing unattended-upgrades

We’ll be working from the terminal, so start a shell if you aren’t already working from the command line.

To install unattended-upgrades on your system, all you need to do is install it using apt:


sudo apt update

sudo apt install unattended-upgrades

These commands will install unattended-upgrades, but it still needs to be tested and enabled before it can be used.Testing unattended-upgrades

Once you’ve installed unattended-upgrades, it’s a good idea to test that everything is working using a dry run. This will check for software which can be updated but will stop short of actually downloading and installing any updates.

To trigger a dry run, type the following:

sudo unattended-upgrade -d -v --dry-run

In the output, you’ll see your system connect to the package servers, download the latest versions of all your packages, and then if updates are available for your system they’ll be listed here. The most important thing to look for is the absence of any errors. If you’re getting errors now, you’ll need to diagnose what’s preventing this from working before proceeding.

Lastly, to enable unattended-upgrades so it automatically runs on your system, type:

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

You’ll be presented with a confirmation screen that you want to enable automatic software updates. Select Yes to proceed.