leg command not found

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

Introduction

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

leg: command not found

or when using sudo you get the following error message

sudo: leg: command not found

Solutions to leg: command not found

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

In Ubuntu leg is provided by peg package.

peg is:

This package provides peg and leg, two utilities that read a Parsing Expression Grammar (PEG) and generate a recursive-descent parser for it.

Unlike lex and yacc, peg and leg support unlimited backtracking, provide ordered choice as a means for disambiguation, and can combine scanning (lexical analysis) and parsing (syntactic analysis) into a single activity.

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

sudo apt-get -y install peg

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

You can also use apt command to install peg.

sudo apt -y install peg

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

sudo aptitude install peg

Summary

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