gcovr command not found

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

Introduction

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

gcovr: command not found

or when using sudo you get the following error message

sudo: gcovr: command not found

Solutions to gcovr: command not found

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

In Ubuntu gcovr is provided by gcovr package.

gcovr is:

The gcovr command provides a utility for running the gcov command and summarizing code coverage results. This command is inspired by the Python coverage.py package, which provides a similar utility in Python. Further, gcovr can be viewed as a command-line alternative of the lcov utility, which runs gcov and generates an HTML output.

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

sudo apt-get -y install gcovr

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

You can also use apt command to install gcovr.

sudo apt -y install gcovr

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

sudo aptitude install gcovr

Summary

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