cpancover command not found

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

Introduction

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

cpancover: command not found

or when using sudo you get the following error message

sudo: cpancover: command not found

Solutions to cpancover: command not found

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

In Ubuntu cpancover is provided by libdevel-cover-perl package.

libdevel-cover-perl is:

Devel::Cover is a Perl module that helps collect and display code coverage information. Code coverage information is collected using a pluggable runops function which counts how many times each op is executed. This data is then mapped back to reality using the B compiler modules. There is also a another statement profiler which needs a better backend to be really useful.

Statement, branch, condition, subroutine, pod and time coverage information is reported. Statement coverage data should be reasonable, although there may be some statements which are not reported. Branch and condition coverage data should be mostly accurate too, although not always what one might initially expect. Subroutine coverage should be as accurate as statement coverage. Pod coverage comes from Pod::Coverage. If Pod::Coverage::CountParents is available it will be used instead. Coverage data for path coverage are not yet collected.

The cover program can be used to generate coverage reports. Another included program, gcov2perl, can convert gcov files to Devel::Cover databases.

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

sudo apt-get -y install libdevel-cover-perl

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

You can also use apt command to install libdevel-cover-perl.

sudo apt -y install libdevel-cover-perl

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

sudo aptitude install libdevel-cover-perl

Summary

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