In Ubuntu Server and other Debian-based Linux distributions, the man-db.timer is a recurring systemd timer unit installed by the man-db package. This timer periodically invokes the mandb utility, which performs a comprehensive filesystem crawl of all configured MANPATH directories to rebuild the manual page index database (/var/cache/man/index.db). The rebuild process involves recursively scanning every installed manual page file, parsing WHATIS entries, resolving symlinks, and updating the search index used by the apropos and whatis commands. While useful on interactive developer workstations, this periodic filesystem-intensive rebuild introduces significant disk I/O contention, CPU overhead, and an unnecessary attack surface on headless Ubuntu Server deployments, containerised microservices, or immutable infrastructure instances where manual pages are never consulted interactively. On high-IOPS production database servers, the periodic mandb crawl competes with critical application I/O workloads.
This guide explains how to completely disable the man-db timer in Ubuntu Server, enforcing an absolute block on automated manual page index rebuilds and eliminating unnecessary periodic filesystem scanning operations.
Stop and Mask the man-db Timer
Because this timer is managed by the man-db package and will be re-enabled by package updates or system upgrades, a simple systemctl disable is insufficient to guarantee the timer will never re-activate. To enforce an absolute block, we must explicitly mask the unit.
- Log into your Ubuntu Server via SSH using an account with
sudoprivileges. - Stop the timer to halt any currently scheduled execution:
sudo systemctl stop man-db.timer - Stop the associated service unit that the timer invokes:
sudo systemctl stop man-db.service - Mask both the timer and service units. This symlinks them to
/dev/null, creating a hard block against future activation by package reinstallations, apt triggers, or manual invocations:sudo systemctl mask man-db.timer sudo systemctl mask man-db.service - Optional but recommended: On minimalist server deployments where manual pages are never needed, consider removing the
man-dbpackage entirely to reclaim disk space:sudo apt purge man-db
Verify the Service Lockdown
By masking the timer and its associated service, you guarantee that systemd will completely reject any attempt to invoke periodic manual page index rebuilds, eliminating unnecessary filesystem scanning on production servers.
To verify the lockdown is successful, attempt to start the timer manually:
sudo systemctl start man-db.timer
Systemd will return a fatal error stating that the unit is masked (e.g., Failed to start man-db.timer: Unit man-db.timer is masked). Furthermore, running systemctl list-timers --all will confirm that the man-db.timer is completely absent from the active timers list. The server’s disk I/O pipeline is now strictly optimised for production workloads without redundant manual page index crawling.