How to Stop Ubuntu from Automatically Generating Man Pages

The Silent CPU Spike

In Ubuntu, the `man` command is the standard way to access manual pages for installed software. To ensure these manuals are indexed and searchable (e.g., using the `apropos` command), Ubuntu utilizes a background database managed by the `mandb` utility. When you install new packages or run large system updates using `apt`, a trigger is often fired that automatically runs `mandb` in the background to update the manual page index. While this keeps the documentation current, the `mandb` process is notoriously I/O and CPU intensive. On older hardware or low-resource Virtual Private Servers (VPS), this automatic generation can cause a noticeable, temporary performance spike immediately following an update.

Disabling the mandb Trigger

To prevent these post-update performance hits and stop Ubuntu from automatically generating man page indexes after package installations, you can disable the `mandb` apt trigger.

This requires administrative privileges in the terminal. Open your terminal (Ctrl+Alt+T). The easiest way to bypass the trigger without breaking the package manager is to override the trigger configuration. Type the following command to create an empty override file: sudo mkdir -p /etc/apt/apt.conf.d/ && echo 'DPkg::Post-Invoke {"";};' | sudo tee /etc/apt/apt.conf.d/99-disable-mandb. However, this is a blunt instrument that might disable all post-invoke hooks depending on syntax.
A safer, more targeted approach is to make the `mandb` trigger executable return true immediately without running. First, back up the trigger file: sudo cp /var/lib/dpkg/info/man-db.triggers /var/lib/dpkg/info/man-db.triggers.bak. Then, empty the file: sudo truncate -s 0 /var/lib/dpkg/info/man-db.triggers. Note that you will now need to manually run sudo mandb if you want your manual page index to be fully up to date with newly installed software.

Get the best tech tips delivered straight to your inbox.

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