dh_modaliases command not found

In this troubleshooting guide we learn how to fix dh_modaliases command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

dh_modaliases: command not found

or when using sudo you get the following error message

sudo: dh_modaliases: command not found

Solutions to dh_modaliases: command not found

How To Fix dh_modaliases: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu dh_modaliases is provided by dh-modaliases package.

dh-modaliases is:

dh_modaliases is useful for packages that ship third-party kernel modules, either in binary form, or as sources (with e. g. DKMS). It extracts the modules’ modaliases from either the compile .ko files themselves (for packages which ship them in compiled form, using modinfo), or from a package file debian/packagename.modaliases.

This enables software which is looking for missing driver packages (such as Jockey or the operating system installer) to identify which package(s) will provide a driver for a piece of hardware, identified by its modalias.

To fix this problem, we can install more using the command below.

sudo apt-get -y install dh-modaliases

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install dh-modaliases.

sudo apt -y install dh-modaliases

Or if you have aptitude installed you can use the following command.

sudo aptitude install dh-modaliases

Summary

In this tutorial we learn how to fix dh_modaliases command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.