How to Fix Failed to Start Daily Man-DB Regeneration in Ubuntu

Ubuntu systemd timers run routine maintenance services to ensure documentation and manual pages remain instantly searchable through commands like man, apropos, and whatis. The man-db.service and man-db.timer rebuild the binary index database in /var/cache/man daily. When running systemctl --failed reports that man-db.service has exited with a failure status, troubleshooting the database cache preserves efficient command documentation lookups.

What Does man-db.service Do?

The manual database service scans installed manual page hierarchies across your Linux file tree:

  • It invokes the binary /usr/bin/mandb --quiet to scan /usr/share/man, /usr/local/man, and third-party package documentation.
  • It generates indexed Berkeley DB (or GDBM) cache files in /var/cache/man/index.db.
  • Failures occur when disk storage in /var is exhausted, corrupted GDBM database files lock write access, or broken symlinks from uninstalled packages cause mandb parser crashes.

1. Inspect Journalctl Logs for the Failure Reason

Checking systemd journal output reveals the specific exit code of the mandb process.

  1. Open your terminal and run:
    sudo journalctl -u man-db.service -n 50 --no-pager
  2. Identify the error messages:
    • mandb: can't create index cache /var/cache/man/...: Permission or disk space error.
    • mandb: fatal: corrupted database: Damaged index file structure.
    • No space left on device: Full partition.

2. Verify Disk Space and Inode Availability

A full filesystem blocks mandb from writing temporary index tables.

  1. Check disk capacity on /var:
    df -h /var/cache/man
  2. Check inode usage:
    df -i /var
  3. If the drive is full, clean package cache files:
    sudo apt-get clean && sudo apt-get autoremove -y

3. Purge Corrupted Manual Cache Files

Removing corrupted index databases allows mandb to construct clean binary indexes from scratch.

  1. Stop any running manual services:
    sudo systemctl stop man-db.service
  2. Purge the cache directory contents:
    sudo rm -rf /var/cache/man/*
  3. Ensure proper directory permissions are restored:
    sudo chown -R man:man /var/cache/man
    sudo chmod 755 /var/cache/man

4. Manually Rebuild the Manual Database

Running the builder with verbose output pinpoints any broken manual packages.

  1. Execute a full manual database regeneration:
    sudo mandb -c
    (The -c flag forces creation of fresh databases from scratch).
  2. Watch the terminal output as it processes language catalogues (e.g. /usr/share/man).
  3. Once complete, verify that /var/cache/man/index.db exists and has non-zero file size:
    ls -lh /var/cache/man/index.db

5. Clear Failed State and Restart the Service

Reset systemd status flags and verify clean execution.

  1. Reset the systemd failure record:
    sudo systemctl reset-failed man-db.service
  2. Trigger the service manually via systemd:
    sudo systemctl start man-db.service
  3. Verify active success status:
    sudo systemctl status man-db.service
  4. Check that the companion timer is scheduled:
    sudo systemctl status man-db.timer

Get the best tech tips delivered straight to your inbox.

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