How to Fix Failed to Start Update Man-Database Cache in Ubuntu

During system boot or package management operations in Ubuntu, systemd may display the red error banner Failed to start Update man-database cache, referencing the failure of man-db.service. This service is responsible for updating the index databases used by the man, whatis, and apropos commands. When the service crashes, it can delay boot sequences, prolong APT installation cycles, and leave documentation queries broken. The failure typically stems from corrupted index caches in /var/cache/man, incorrect directory permissions, interrupted dpkg triggers, or disk space depletion.

Inspect systemd Service Logs for Failure Cause

Before executing repairs, examine the precise diagnostic trace recorded by systemd to confirm whether the crash is caused by permission denials, corrupted database formats, or syntax issues in custom manual pages.

  1. Open a terminal on your Ubuntu system.
  2. Query the current status of the unit:
    systemctl status man-db.service
  3. Examine the detailed journal logs:
    journalctl -u man-db.service -e --no-pager
  4. Look for error indicators such as mandb: can't create index cache, mandb: /var/cache/man: Permission denied, or mandb: fatal: error writing to index file.

Purge and Regenerate the Manual Database Cache

If the binary index file stored in /var/cache/man has suffered corruption due to an unclean system shutdown or an aborted package update, purging the cache and rebuilding it from scratch resolves the failure immediately.

  1. Stop any running instances of the service:
    sudo systemctl stop man-db.service man-db.timer
  2. Remove the existing manual index databases:
    sudo rm -rf /var/cache/man/*
  3. Execute a manual database rebuild using the mandb utility with diagnostic flags:
    sudo mandb -c
  4. The -c parameter instructs mandb to create new index files from scratch rather than attempting to update existing corrupted structures.
  5. Wait for the scanning process across /usr/share/man to conclude. Verify that the output concludes with 0 man subdirectories contained newer manual pages without fatal errors.

Verify File System Permissions on /var/cache/man

The man-db daemon runs under the unprivileged system user man. If ownership or write permissions on /var/cache/man have been altered by administrative scripts or misconfigured backup restorations, the update service will fail with permission errors.

  1. Check the existing ownership of the cache directory:
    ls -ld /var/cache/man
  2. The directory should be owned by user man and group man, with drwxr-xr-x (0755) permissions.
  3. If ownership has shifted to root:root, reset it:
    sudo chown -R man:man /var/cache/man
  4. Restore standard read, write, and execute permissions:
    sudo chmod -R 755 /var/cache/man
  5. Restart the service to confirm access:
    sudo systemctl start man-db.service

Reinstall the man-db Package and Reconfigure DPKG Triggers

If core system configuration files under /etc/cron.daily/man-db or the systemd unit files themselves are corrupted, reinstalling the package restores canonical system binaries and registers standard triggers.

  1. Reinstall the man-db package:
    sudo apt-get install --reinstall man-db
  2. Reconfigure pending package triggers:
    sudo dpkg --configure -a
  3. Enable the systemd background timer so updates occur automatically without blocking interactive logins:
    sudo systemctl enable --now man-db.timer
  4. Verify that the service now passes cleanly:
    sudo systemctl status man-db.service

Get the best tech tips delivered straight to your inbox.

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