How to Fix Failed to Start Daily apt Upgrade Activities in Ubuntu

Ubuntu uses background systemd timers and service units to automate security updates and package repository caching. Among these units, apt-daily-upgrade.service and apt-daily.service execute on periodic daily schedules triggered by systemd.timer. During system boots or while reviewing system health via systemctl --failed, system administrators frequently observe the error: Failed to start Daily apt upgrade and clean activities or apt-daily-upgrade.service: Main process exited, code=exited, status=100/n/a.

Why Does the Daily apt Upgrade Activity Service Fail?

The apt-daily-upgrade service triggers /usr/lib/apt/apt.systemd.daily. It typically crashes due to lock file contention, interrupted dpkg operations, or repository metadata corruption. Common causes include:

  • Dpkg Frontend Lock Contention: A manual apt or unattended-upgrades process is already executing in the background, locking /var/lib/dpkg/lock-frontend.
  • Interrupted Package Configuration: A previous installation or kernel upgrade crashed halfway, leaving unconfigured packages requiring dpkg --configure -a.
  • Broken Third-Party APT PPA Repositories: Deprecated or unreachable external package sources returning HTTP 404 or GPG signature verification errors.
  • Full Root Filesystem (/var/cache/apt): Insufficient remaining disk space inside /var preventing the download and extraction of new deb packages.
  • Corrupted APT Lists Cache: Binary database corruption inside /var/lib/apt/lists/.

Method 1: Check Systemd Journal Logs for Detailed Error Codes

Inspect the specific exit code and crash trace generated by the systemd unit.

  1. Open your terminal and query the unit status:
    systemctl status apt-daily-upgrade.service
  2. View the detailed execution log using journalctl:
    journalctl -u apt-daily-upgrade.service -e --no-pager
  3. Check if the log reports Could not get lock /var/lib/dpkg/lock-frontend or E: Problem parsing dependency.

Method 2: Remove Stale APT and DPKG Lock Files

If previous upgrade processes terminated unexpectedly, leftover lock files prevent the daily timer from executing.

  1. First, verify whether any apt process is currently running:
    ps aux | grep -i apt
  2. If no legitimate update is in progress, remove any orphaned lock files:
    sudo rm -f /var/lib/apt/lists/lock
    sudo rm -f /var/cache/apt/archives/lock
    sudo rm -f /var/lib/dpkg/lock*
  3. Reconfigure pending packages:
    sudo dpkg --configure -a

Method 3: Clear and Rebuild Corrupted APT Package Lists

Corrupted repository index files prevent automated update routines from resolving dependencies.

  1. Purge cached package list files:
    sudo rm -rf /var/lib/apt/lists/*
  2. Clean the local apt archive cache:
    sudo apt clean && sudo apt autoclean
  3. Rebuild the package index:
    sudo apt update
  4. Verify that no unreachable PPA repositories or 404 errors appear during the index rebuild.

Method 4: Manually Test the Daily Script Execution

Run the underlying maintenance shell script manually to confirm error-free execution.

  1. Execute the script in debug mode:
    sudo /usr/lib/apt/apt.systemd.daily
  2. If the script completes without outputting errors, start the systemd service manually:
    sudo systemctl start apt-daily-upgrade.service
  3. Check its status to verify it now reports active (exited) with success:
    systemctl status apt-daily-upgrade.service

Method 5: Reset Systemd Failed State and Verify Timers

Clear the systemd degraded status flag and verify the associated timers are active.

  1. Reset systemd failed units:
    sudo systemctl reset-failed apt-daily-upgrade.service
  2. Verify that both related timers are running normally:
    systemctl list-timers | grep -E "apt-daily|apt-daily-upgrade"
  3. If the timers are inactive or masked, re-enable them:
    sudo systemctl unmask apt-daily-upgrade.timer
    sudo systemctl enable --now apt-daily-upgrade.timer

Get the best tech tips delivered straight to your inbox.

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