cpaninject command not found

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

Introduction

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

cpaninject: command not found

or when using sudo you get the following error message

sudo: cpaninject: command not found

Solutions to cpaninject: command not found

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

In Ubuntu cpaninject is provided by libcpan-inject-perl package.

libcpan-inject-perl is:

CPAN::Inject is a Perl module that provides a simple and reusable interface for injecting arbitrary packages to a CPAN mirror. Specifically, it accepts any Perl distribution tarball and performs some processing to make it look like it came from CPAN. Subsequently, the package will be installable from the CPAN Shell, with the full automatic recursive dependency resolution.

This package also provides a command line utility, cpaninject, which can be used to inject arbitrary packages under the officially blessed “Reserved Local CPAN Author” id, LOCAL.

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

sudo apt-get -y install libcpan-inject-perl

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

You can also use apt command to install libcpan-inject-perl.

sudo apt -y install libcpan-inject-perl

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

sudo aptitude install libcpan-inject-perl

Summary

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