How to Fix Failed to Start packagekit service in Ubuntu

The PackageKit system service (packagekit.service) in Ubuntu and Debian-based distributions acts as a unified system daemon providing an abstraction layer over native package managers like apt. Desktop frontends such as GNOME Software, discover, and background update notifiers use PackageKit to check for updates and install security patches. When the daemon crashes due to damaged transaction databases or conflicting package locks, systemd marks the unit as failed: Failed to start packagekit.service: Unit entered failed state.

Inspect systemd Status and Journal Crash Diagnostics

Determine whether the service failure is caused by an active apt lock, a damaged cache database, or a DBus communication refusal.

sudo systemctl status packagekit.service
sudo journalctl -u packagekit.service -b --no-pager -e

Common failure signatures include “could not acquire lock /var/lib/dpkg/lock-frontend” or “failed to load packagekit backend database”.

Resolve Stale APT and DPKG Process Locks

PackageKit requires exclusive access to APT database locks. If an automated background unattended-upgrades job crashed or an apt process was interrupted, stale lock files prevent PackageKit from initializing.

  1. Check if any background apt processes are currently active:
    ps aux | grep -E 'apt|dpkg'
  2. If orphaned apt processes are holding locks, terminate them or wait for unattended upgrades to conclude:
    sudo killall apt apt-get dpkg
  3. Safely remove stale lock files if no apt processes are actively executing:
    sudo rm -f /var/lib/apt/lists/lock
    sudo rm -f /var/cache/apt/archives/lock
    sudo rm -f /var/lib/dpkg/lock*
  4. Reconfigure pending packages:
    sudo dpkg --configure -a

Clear Corrupted PackageKit Transaction and Cache Files

PackageKit maintains its own SQLite database of transactions and software repositories in /var/lib/PackageKit. Corrupted records will cause the daemon to crash immediately on startup.

  1. Stop the service completely:
    sudo systemctl stop packagekit.service
  2. Purge the internal PackageKit transaction state and cache:
    sudo rm -rf /var/lib/PackageKit/transactions.db
    sudo rm -rf /var/cache/PackageKit/*
  3. Start the PackageKit daemon:
    sudo systemctl start packagekit.service
  4. Verify that the service is running:
    sudo systemctl is-active packagekit.service

Reinstall PackageKit and Refresh Repository Indexes

If binary files or DBus policy configurations within /etc/dbus-1/system.d/org.freedesktop.PackageKit.conf were damaged, reinstalling the package restores proper system configuration.

sudo apt update
sudo apt install --reinstall -y packagekit
sudo systemctl daemon-reload
sudo systemctl restart packagekit.service

Test daemon responsiveness by executing a query from the command line: pkcon get-updates.

Get the best tech tips delivered straight to your inbox.

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