
Overview
Keeping your servers updated with the latest security patches and software updates is crucial for system stability and security. This guide will show you how to enable automatic updates on Debian and Ubuntu 22.04 / 24.04 to ensure that important updates are installed regularly.
Step 1: Install Unattended Upgrades
First, install the unattended-upgrades package, which handles automatic updates.
sudo apt update && sudo apt install unattended-upgrades -y
Step 2: Enable Automatic Updates
By default, unattended-upgrades may already be enabled, but you should verify and configure it for your needs.
To check if it’s active:
sudo systemctl status unattended-upgrades
If it’s inactive, enable it manually:
sudo systemctl enable –now unattended-upgrades
Step 3: Configure Automatic Updates
To customize the update settings, open the configuration file:
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
Look for this section:
// Unattended-Upgrade::Allowed-Origins {
// “${distro_id}:${distro_codename}-updates”;
// “${distro_id}:${distro_codename}-security”;
// };
Uncomment the lines by removing // at the beginning to enable updates:
Unattended-Upgrade::Allowed-Origins {
“${distro_id}:${distro_codename}-updates”;
“${distro_id}:${distro_codename}-security”;
};
Save and exit by pressing CTRL + X, then Y, and Enter.
Step 4: Set Update Frequency
Open the periodic updates configuration file:
sudo nano /etc/apt/apt.conf.d/10periodic
Modify or add these lines to set the update interval in days:
APT::Periodic::Update-Package-Lists “1”;
APT::Periodic::Download-Upgradeable-Packages “1”;
APT::Periodic::AutocleanInterval “7”;
APT::Periodic::Unattended-Upgrade “1”;
"1"means the system will check for updates daily."7"means it will clean old packages weekly.
Save and exit the file.
Step 5: Configure Email Notifications (Optional)
To receive email alerts about automatic updates, install apticron:
sudo apt install apticron -y
Open the configuration file:
sudo nano /etc/apticron/apticron.conf
Find the line that starts with EMAIL="root" and replace "root" with your email address:
EMAIL=”your-email@example.com“
Save and exit.
Step 6: Test Automatic Updates
To manually trigger an update and test the settings:
sudo unattended-upgrades –dry-run –debug
If everything is configured correctly, your system will now automatically check, download, and install updates, ensuring security and stability.
Would you like help configuring additional security measures or troubleshooting update issues? Let me know! ?
Information reviewed and updated: August 26, 2026.
Published by: REVOLD BLOG – blog.revold.us
Powered by AIR RISE INC & REVOLD AI
Sponsored: CORPIUS
Author: Roman Kravchina
Related Reading on Revold Blog
- How to set up an Ubuntu-based NAS
- How to Install Proxmox VE on Windows 8.3
- How to Quickly Install Heimdall Using Docker
- How To Install PhotoPrism Using Docker Compose
- More Developing & Programming guides
- How to Install Jitsi Meet on Ubuntu/Debian with Automatic Let’s Encrypt SSL
- CentOS Automatic Updates Versions 9, 10, 11
- How to Set Up Automatic Updates for CentOS 10
- Install Docker Compose on Linux Ubuntu 22.04, Debian or up
- How to Install Python Pip on Ubuntu 22.04
- Proxmox Maintenance Script: Automate Updates and Reboots
- How to Install NGINX FastCGI Cache Purge Module Without Reinstalling NGINX on Ubuntu (Latest Versions)
- This guide will show you how to install a desktop (GUI) graphical interface on your Ubuntu server.
- How to Install Searx Search Engine on Ubuntu / debianArch LinuxFedora / RHEL
- How to Install NVIDIA Drivers on Ubuntu 22.04 LTS
- How to Install Jellyfin Media Server on Ubuntu 24.04
- How To Set Up a Node.js Application for Production on Ubuntu 24.04
- How to Update PHP Version in Ubuntu 24,04


