dh_apache2 command not found

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

Introduction

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

dh_apache2: command not found

or when using sudo you get the following error message

sudo: dh_apache2: command not found

Solutions to dh_apache2: command not found

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

In Ubuntu dh_apache2 is provided by apache2-dev package.

apache2-dev is:

The Apache HTTP Server Project’s goal is to build a secure, efficient and extensible HTTP server as standards-compliant open source software. The result has long been the number one web server on the Internet.

This package provides development headers and the apxs2 binary for the Apache 2 HTTP server, useful to develop and link third party additions to the Debian Apache HTTP server package.

It also provides dh_apache2 and dh sequence addons useful to install various Debian Apache2 extensions with debhelper. It supports

  • Apache 2 module configurations and shared objects
  • Site configuration files
  • Global configuration files

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

sudo apt-get -y install apache2-dev

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

You can also use apt command to install apache2-dev.

sudo apt -y install apache2-dev

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

sudo aptitude install apache2-dev

Summary

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