nginx-confgen command not found

In this troubleshooting guide we learn how to fix nginx-confgen command not found error message

Introduction

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

nginx-confgen: command not found

or when using sudo you get the following error message

sudo: nginx-confgen: command not found

Solutions to nginx-confgen: command not found

How To Fix nginx-confgen: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu nginx-confgen is provided by nginx-confgen package.

nginx-confgen is:

This is a preprocessor and macro system for nginx(-like) configuration files. It can be used to do pre-processing for nginx configuration files (and other configuration files with a similar syntax). It has support for “compile-time” macro expansion and variable interpolation, which should make it less tedious to maintain large and complex configurations.

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

sudo apt-get -y install nginx-confgen

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

You can also use apt command to install nginx-confgen.

sudo apt -y install nginx-confgen

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

sudo aptitude install nginx-confgen

Summary

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