mkpasswd command not found

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

Introduction

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

mkpasswd: command not found

or when using sudo you get the following error message

sudo: mkpasswd: command not found

Solutions to mkpasswd: command not found

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

In Ubuntu mkpasswd is provided by whois package.

whois is:

This package provides a commandline client for the WHOIS (RFC 3912) protocol, which queries online servers for information such as contact details for domains and IP address assignments. It can intelligently select the appropriate WHOIS server for most queries.

The package also contains mkpasswd, a features-rich front end to the password encryption function crypt(3).

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

sudo apt-get -y install whois

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

You can also use apt command to install whois.

sudo apt -y install whois

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

sudo aptitude install whois

Summary

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