How to Disable the Ubuntu ‘apt-daily’ Service to Prevent Startup Lag

The Startup Bottleneck

In Ubuntu, the apt package manager is essential for installing and updating software. To ensure your system always knows about the latest security patches, Ubuntu runs two background systemd timers: apt-daily.timer and apt-daily-upgrade.timer. These services trigger shortly after the system boots, quietly downloading package lists and applying unattended upgrades.

If you are running Ubuntu on an older laptop or a Raspberry Pi, this background process can cause severe startup lag. For the first few minutes after logging in, the system will feel sluggish, and if you immediately open the terminal and try to install something (e.g., sudo apt install htop), you will receive an infuriating error saying “Could not get lock /var/lib/dpkg/lock-frontend” because the background service is holding the lock. You can disable these automatic updates to regain control of your boot sequence.

How to Disable the Apt-Daily Services

You can turn off these automatic update timers using systemctl.

  1. Open your Ubuntu Terminal (or connect via SSH).
  2. First, stop the services if they are currently running:
sudo systemctl stop apt-daily.service
sudo systemctl stop apt-daily-upgrade.service
  1. Next, disable the timers so they do not trigger automatically on future boots:
sudo systemctl disable apt-daily.timer
sudo systemctl disable apt-daily-upgrade.timer
  1. Finally, to ensure no other process can accidentally trigger them, mask the services:
sudo systemctl mask apt-daily.service
sudo systemctl mask apt-daily-upgrade.service

Your Ubuntu machine will now boot faster, and you will never encounter the “lock-frontend” error immediately after logging in. However, remember that your system will no longer check for updates automatically. You must manually run sudo apt update && sudo apt upgrade periodically to keep your system secure.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.