dh_bash-completion command not found

In this troubleshooting guide we learn how to fix dh_bash-completion command not found error message

Introduction

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

dh_bash-completion: command not found

or when using sudo you get the following error message

sudo: dh_bash-completion: command not found

Solutions to dh_bash-completion: command not found

How To Fix dh_bash-completion: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu dh_bash-completion is provided by bash-completion package.

bash-completion is:

bash completion extends bash’s standard completion behavior to achieve complex command lines with just a few keystrokes. This project was conceived to produce programmable completion routines for the most common Linux/UNIX commands, reducing the amount of typing sysadmins and programmers need to do on a daily basis.

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

sudo apt-get -y install bash-completion

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

You can also use apt command to install bash-completion.

sudo apt -y install bash-completion

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

sudo aptitude install bash-completion

Summary

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