pwgen command not found

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

Introduction

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

pwgen: command not found

or when using sudo you get the following error message

sudo: pwgen: command not found

Solutions to pwgen: command not found

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

In Ubuntu pwgen is provided by pwgen package.

pwgen is:

pwgen generates random, meaningless but pronounceable passwords. These passwords contain either only lowercase letters, or upper and lower case mixed, or digits thrown in. Uppercase letters and digits are placed in a way that eases remembering their position when memorizing only the word.

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

sudo apt-get -y install pwgen

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

You can also use apt command to install pwgen.

sudo apt -y install pwgen

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

sudo aptitude install pwgen

Summary

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