dh_xsf_substvars command not found

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

Introduction

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

dh_xsf_substvars: command not found

or when using sudo you get the following error message

sudo: dh_xsf_substvars: command not found

Solutions to dh_xsf_substvars: command not found

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

In Ubuntu dh_xsf_substvars is provided by xserver-xorg-dev package.

xserver-xorg-dev is:

This package provides development files for the X.Org (‘Xorg’) X server. This is not quite the same as the DDK (Driver Development Kit) from the XFree86 4.x and X.Org 6.7, 6.8 and 6.9 series of servers; it provides headers and a pkg-config file for drivers using autotools to build against.

Unless you are developing or building a driver, you probably want xserver-xorg and/or xserver-xorg-core instead.

More information about X.Org can be found at: URL:https://www.x.org

This package is built from the X.org xserver module.

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

sudo apt-get -y install xserver-xorg-dev

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

You can also use apt command to install xserver-xorg-dev.

sudo apt -y install xserver-xorg-dev

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

sudo aptitude install xserver-xorg-dev

Summary

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