Unattended Upgrade is a Debian package designed to enhance the security of your system by automating the installation of critical updates. This tool ensures that your computer remains protected against the latest security vulnerabilities and benefits from important software improvements without requiring manual intervention. By automatically downloading and installing updates, Unattended Upgrades helps maintain the integrity of your Debian system, allowing operators to focus on their tasks. Whether you’re managing a single desktop or a large network of machines, Unattended Upgrades provides a solution for keeping your systems current and secure.
Installing and Configuring Unattended Upgrades on Debian
To keep your Debian system up-to-date with the latest security patches and software updates automatically, follow these steps to install and configure Unattended Upgrades:
Install the Unattended Upgrades Package
Open a terminal and run the following command to install the Unattended Upgrades package
sudo apt install unattended-upgrades
Update the Configuration File
Edit the configuration file to specify which updates should be automatically installed. Open the file
/etc/apt/apt.conf.d/50unattended-upgrades
in a text editor, such as vi
m
sudo vim /etc/apt/apt.conf.d/50unattended-upgrades
Add or update the file with the following content:
Enable Periodic Updates
To enable periodic updates, edit the /etc/apt/apt.conf.d/20auto-upgrades
file
sudo vim /etc/apt/apt.conf.d/20auto-upgrades
Add the following lines
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1"; APT::Periodic::AutocleanInterval "7";
Enable and Restart the Service
Enable and restart the Unattended Upgrades service to apply the changes
sudo systemctl enable unattended-upgrades
sudo systemctl restart unattended-upgrades
Test Your Setup
To ensure that your setup is working correctly, run a dry-run test with debug output
sudo unattended-upgrades --dry-run --debug
By following these steps, you will configure your Debian system to automatically install important updates, enhancing its security and stability.
Sources:
- https://wiki.debian.org/UnattendedUpgrades
- https://www.linode.com/docs/guides/how-to-configure-automated-security-updates-debian/