perl command not found

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

Introduction

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

perl: command not found

or when using sudo you get the following error message

sudo: perl: command not found

Solutions to perl: command not found

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

In Ubuntu perl is provided by perl-base package.

perl-base is:

Perl is a scripting language used in many system scripts and utilities.

This package provides a Perl interpreter and the small subset of the standard run-time library required to perform basic tasks. For a full Perl installation, install “perl” (and its dependencies, “perl-modules-5.34” and “perl-doc”).

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

sudo apt-get -y install perl-base

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

You can also use apt command to install perl-base.

sudo apt -y install perl-base

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

sudo aptitude install perl-base

Summary

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