How to Completely Disable the ‘systemd-hwdb-update’ Service in Ubuntu Server

In Ubuntu Server, the systemd-hwdb-update.service is a systemd unit responsible for rebuilding the hardware database (hwdb.bin) during the boot sequence. This database maps hardware identification strings (such as USB vendor/product IDs or Bluetooth company identifiers) to human-readable names and specific configuration rules (like custom keyboard mappings or mouse DPI settings). While this update process is crucial on desktop systems where users frequently plug in exotic, new hardware peripherals, it is entirely unnecessary on static, headless servers or virtual machines whose hardware profiles remain completely static for their entire lifecycle. Rebuilding the database on every boot (or when triggered by package updates) simply wastes CPU cycles and I/O operations.

This guide explains how to completely disable the systemd-hwdb-update.service in Ubuntu Server, ensuring the system relies on the existing hardware database without attempting to rebuild it dynamically.

Stop and Mask the systemd-hwdb-update Service

Because this service is designed to trigger automatically based on file modifications in /usr/lib/udev/hwdb.d/ or via other systemd dependencies, we must disable and explicitly mask it to prevent it from ever executing.

  1. Log into your Ubuntu Server via SSH using an account with sudo privileges.
  2. You generally cannot “stop” this service on a running system as it executes briefly and exits (it is a Type=oneshot service). Proceed directly to disabling it:
    sudo systemctl disable systemd-hwdb-update.service
  3. Next, to guarantee that systemd treats the unit as a black hole and never attempts to execute it during boot or during apt package upgrades, mask it entirely:
    sudo systemctl mask systemd-hwdb-update.service

Verify the Service Lockdown

By masking the service, you have instructed systemd to symlink the unit file to /dev/null, effectively removing the hardware database recompilation capability from the operating system.

To verify the lockdown is successful, run the following command to check the status of the service:

systemctl status systemd-hwdb-update.service

The output will clearly state that the service is masked. Additionally, you can manually attempt to trigger a database rebuild by executing sudo systemd-hwdb update. While the manual command itself will still function (as it bypasses the systemd unit wrapper), the automated service that runs during the boot phase is now permanently disabled, streamlining your server’s startup process.

Get the best tech tips delivered straight to your inbox.

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