Running system maintenance or reviewing boot health using systemctl --failed on an Ubuntu server or desktop system can reveal man-db.service: Failed with result 'exit-code' or Failed to start Daily man-db regeneration. This background maintenance task indexes manual pages for the man command. When it fails daily, it can clog cron log notifications and indicate underlying disk permission or index file corruption.
Why Does the Daily man-db Regeneration Service Fail in Ubuntu?
The man-db.timer unit triggers man-db.service once per day to index newly installed software manuals. Typical failure causes include:
- Corrupted index.db Binary Database: An ungraceful system shutdown or hard reboot corrupting
/var/cache/man/index.db. - Orphaned Lock Files: Stale lock files inside
/var/cache/man/preventing themandbprocess from obtaining exclusive file access. - Disk Quota or Inode Exhaustion: Small cloud virtual private servers (VPS) exhausting available disk space or filesystem inodes in
/var/cache/. - Directory Permission Changes: The dedicated
manuser or group lacking write permissions to/var/cache/man.
1. Review systemd Journal Logs for Detailed Errors
Check the exact failure reason recorded by systemd.
sudo systemctl status man-db.service
For more detailed diagnostic context from recent runs:
sudo journalctl -u man-db.service -n 50 --no-pager
Look for clues such as mandb: can't create index cache /var/cache/man/index.db, No space left on device, or Permission denied.
2. Purge Stale Lock Files and Corrupt Cache
Removing corrupted database binaries allows the system to rebuild indexing structures cleanly.
- Terminate any hung indexing tasks:
sudo killall mandb 2>/dev/null - Delete old lock files and corrupted databases:
sudo rm -f /var/cache/man/*.lock sudo rm -f /var/cache/man/index.db - Restore standard ownership and permissions:
sudo chown -R man:man /var/cache/man sudo chmod -R 755 /var/cache/man
3. Manually Force Rebuild of the Manual Index
Execute the mandb utility with clean rebuild parameters to generate a fresh index database.
sudo mandb -c
The -c switch instructs the utility not to look for existing databases and create a pristine index from scratch across /usr/share/man. This process will take 30 to 60 seconds.
4. Test the systemd Service and Maintenance Timer
Trigger the systemd service manually to verify clean execution.
sudo systemctl start man-db.service
sudo systemctl status man-db.service
Confirm that the status shows Active: inactive (dead) with Result: success. Next, confirm that the automated maintenance timer is running:
sudo systemctl status man-db.timer
Confirm that systemctl --failed reports zero degraded units across your Ubuntu installation.