By default, Ubuntu Linux runs a background daemon called unattended-upgrades. This daemon automatically wakes up in the middle of the night, connects to Canonical’s servers, downloads the latest software packages, and installs them silently. If it installs a critical kernel patch, the daemon might even force your computer to reboot automatically.
While this is fantastic for keeping a casual desktop secure, it is a nightmare if you are running a production web server, a long-running video render, or a scientific simulation. A forced overnight reboot will instantly destroy hours of active processing. If you prefer to manually review and install updates on your own schedule, you must completely block this automated service.
How to Completely Block Ubuntu Unattended Upgrades
You must edit the official APT package manager configuration file to disable the automated timers.
- Open your Terminal application (Ctrl + Alt + T).
- First, we will edit the configuration file that controls the automatic update timers. Type the following command to open the file in the nano text editor:
sudo nano /etc/apt/apt.conf.d/20auto-upgrades - Type your administrator password when prompted.
- You will see a small text file that likely looks like this:
APT::Periodic::Update-Package-Lists "1";APT::Periodic::Unattended-Upgrade "1"; - The “1” means the feature is turned on (it runs every 1 day). Change both of the “1” values to “0”.
- The file should now look exactly like this:
APT::Periodic::Update-Package-Lists "0";APT::Periodic::Unattended-Upgrade "0"; - Press Ctrl + O to save the file, press Enter to confirm, and then press Ctrl + X to exit the nano editor.
- To guarantee the background daemon is permanently neutralized, type this final command and press Enter:
sudo systemctl disable unattended-upgrades
Ubuntu will never again download or install packages automatically behind your back. Your system will only update when you manually open the terminal and explicitly type sudo apt upgrade, ensuring your long-running tasks are never interrupted by a forced reboot.