How to Disable Automatic Updates in Ubuntu (Complete Guide)
By default, Ubuntu automatically installs updates to keep your system secure and stable. While this behavior is ideal for most desktop users, it can be problematic in production environments, test servers, or any situation where you need precise control over software versions. Unexpected updates can break dependencies, interrupt running services, or introduce regressions that are difficult to diagnose under pressure.
This guide walks you through every method to disable automatic updates in Ubuntu β covering APT, Snap, and systemd timers β along with best practices for staying secure while managing updates manually.
Why You Might Want to Disable Automatic Updates
Automatic updates are a sensible default, but there are legitimate reasons to turn them off:
- Server stability: On a VPS Hosting or dedicated server environment, an unplanned kernel update or service restart can cause unexpected downtime.
- Version pinning: Applications with strict dependency requirements may break if underlying packages are silently upgraded.
- Testing environments: Reproducible test environments require consistent package versions across runs.
- Controlled deployment pipelines: DevOps workflows often manage updates through CI/CD pipelines rather than the OS itself.
- Resource constraints: Automatic background updates consume CPU, RAM, and bandwidth β resources that may be critical on a busy server.
Understanding the trade-offs is essential. Disabling automatic updates shifts the responsibility of security patching entirely to you.
Main Automatic Update Mechanisms in Ubuntu
Before disabling anything, it helps to understand what you are actually turning off. Ubuntu uses four primary mechanisms for automatic updates:
| Mechanism | Purpose |
|---|---|
unattended-upgrades | Automatically installs security and other updates |
APT::Periodic | Controls how often APT checks for and downloads updates |
snapd | Automatically refreshes Snap packages |
systemd timers | Schedules background APT update tasks |
Each of these can be disabled independently, giving you granular control over your system's update behavior.
Method 1: Disable Automatic APT Updates via Configuration File
This is the most common and recommended approach. Ubuntu's APT periodic configuration is stored in /etc/apt/apt.conf.d/20auto-upgrades.
Step 1: Open the Configuration File
sudo nano /etc/apt/apt.conf.d/20auto-upgradesStep 2: Modify the Configuration Values
You will typically see something like this:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";Change both values to "0" to disable automatic list updates and unattended upgrades:
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";Step 3: Save and Exit
Press Ctrl+O to save the file, then Ctrl+X to exit the nano editor.
Optional: Extended APT Periodic Settings
For more granular control, you can also edit or create /etc/apt/apt.conf.d/10periodic:
sudo nano /etc/apt/apt.conf.d/10periodicSet all values to "0":
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";This ensures no background APT activity takes place.
Method 2: Remove the unattended-upgrades Package Entirely
If you prefer a more definitive approach, you can remove the unattended-upgrades package altogether:
sudo apt remove unattended-upgrades -yTo also remove its configuration files:
sudo apt purge unattended-upgrades -yThis completely eliminates the service responsible for automatic security updates. Use this approach only if you are confident in your manual update workflow.
Method 3: Disable Automatic Snap Updates
Snap packages are managed by snapd and update independently of APT. There are two ways to handle this.
Option A: Stop and Disable the snapd Service
This is the most aggressive approach and will prevent all Snap functionality:
sudo systemctl stop snapd.service
sudo systemctl disable snapd.service> Note: Disabling snapd entirely will prevent all Snap packages from running. Only use this if you do not rely on any Snap-based applications.
Option B: Modify the Snap Refresh Schedule (Recommended)
A safer approach is to set the refresh timer to a window that never occurs, effectively blocking auto-updates while keeping Snap functional:
sudo snap set system refresh.timer=00:00-00:00Alternatively, you can use systemctl edit to override the service environment:
sudo systemctl edit snapd.serviceAdd the following block:
[Service]
Environment=SNAPD_REFRESH_TIMER=00:00-00:00Save and exit. This blocks Snap from auto-refreshing packages without disabling the service entirely.
Method 4: Disable systemd Timers for APT
Ubuntu uses systemd timers to schedule APT update tasks. These timers run independently of the unattended-upgrades service and should also be disabled for complete control.
Disable and stop both timers with a single command:
sudo systemctl disable --now apt-daily.timer
sudo systemctl disable --now apt-daily-upgrade.timerapt-daily.timerβ triggers the daily APT package list updateapt-daily-upgrade.timerβ triggers the daily upgrade process
The --now flag both disables the timer from starting at boot and stops it immediately if it is currently running.
How to Verify That Automatic Updates Are Disabled
After applying the changes above, confirm everything is correctly disabled.
Check systemd Timer Status
systemctl status apt-daily.timer apt-daily-upgrade.timerBoth timers should report as inactive (dead). If either shows as active, revisit the disable steps above.
Verify APT Configuration
cat /etc/apt/apt.conf.d/20auto-upgradesExpected output:
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";Check unattended-upgrades Service Status
systemctl status unattended-upgradesIf you removed the package, this command will return an error indicating the service does not exist β which is the expected result.
Important Security Considerations After Disabling Auto Updates
Disabling automatic updates is a valid administrative choice, but it comes with real responsibilities. Here is what you must do to keep your system secure:
1. Update Manually and Regularly
Run the following commands on a consistent schedule β at minimum, weekly:
sudo apt update && sudo apt upgrade -yFor a full distribution-level upgrade:
sudo apt full-upgrade -y2. Monitor Security Advisories
Subscribe to the Ubuntu Security Notices (USN) mailing list or RSS feed. This ensures you are aware of critical vulnerabilities as soon as they are disclosed.
3. Take Snapshots Before Updating
On production servers, always create a system snapshot or backup before applying updates. If you are running a Dedicated Server, use your provider's snapshot tools or a solution like rsync, Timeshift, or LVM snapshots to create a restore point.
4. Use a Staging Environment
Test updates in a staging or development environment before applying them to production. This is especially important for servers running complex stacks.
5. Audit Installed Packages Periodically
apt list --upgradableThis shows all packages with available updates, allowing you to selectively apply patches based on priority.
How to Re-Enable Automatic Updates
If you decide to restore automatic update behavior, the process is straightforward.
Re-enable via Configuration File
Edit /etc/apt/apt.conf.d/20auto-upgrades and set values back to "1":
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";Reinstall unattended-upgrades
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure -plow unattended-upgradesRe-enable systemd Timers
sudo systemctl enable --now apt-daily.timer
sudo systemctl enable --now apt-daily-upgrade.timerRe-enable Snap Auto-Refresh
sudo snap set system refresh.timer=00:00~24:00/4This restores the default Snap refresh schedule (four times per day at random intervals).
Choosing the Right Hosting Environment for Manual Update Control
If you are managing updates manually, the type of hosting environment you use matters significantly. Full root access is essential for the level of control described in this guide.
- VPS Hosting β Ideal for developers and sysadmins who need full control over their Ubuntu environment, including update management, kernel configuration, and service scheduling.
- Dedicated Servers β Best for high-traffic production workloads where update timing, resource usage, and stability are mission-critical.
- VPS with cPanel β A good option if you want root-level control combined with a graphical interface for managing server settings and hosted websites.
Shared hosting environments typically do not provide the OS-level access required to modify APT or systemd configurations.
Quick Reference: All Commands at a Glance
# Disable APT auto-updates via config
sudo nano /etc/apt/apt.conf.d/20auto-upgrades
# Set both values to "0"
# Remove unattended-upgrades package
sudo apt remove unattended-upgrades -y
# Disable Snap auto-refresh (safe method)
sudo snap set system refresh.timer=00:00-00:00
# Disable Snap service entirely (aggressive)
sudo systemctl stop snapd.service
sudo systemctl disable snapd.service
# Disable systemd APT timers
sudo systemctl disable --now apt-daily.timer
sudo systemctl disable --now apt-daily-upgrade.timer
# Verify timer status
systemctl status apt-daily.timer apt-daily-upgrade.timer
# Manual update command
sudo apt update && sudo apt upgrade -yConclusion
Disabling automatic updates in Ubuntu gives you precise control over when and how changes are applied to your system. This is particularly valuable in server environments, CI/CD pipelines, and any context where stability and predictability take priority over immediacy.
The process involves four key areas: APT periodic configuration, the unattended-upgrades package, Snap's refresh mechanism, and systemd timers. Addressing all four ensures that no background update process can modify your system without your explicit action.
However, this control comes with responsibility. You must commit to a regular manual update schedule, monitor security advisories, and maintain backups before applying changes. A well-managed server with manual updates is secure β a neglected one is not.
Whether you are running a development environment, a production application server, or a specialized workload on GPU Hosting, understanding and controlling your update strategy is a fundamental part of professional system administration.
on All Hosting Services