Ways to Install or Uninstall gcovr Ubuntu 22.04

Updated: August 30, 2022

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. I will show you how to install gcovr on Ubuntu 22.04 in this tutorial.

Software Requirement

  • OS: Ubuntu 22.04 is needed for gcovr to work
  • Privileges: Verify that you can execute the sudo commands line.

Prerequisites to install gcovr on Ubuntu 22.04

Install gcovr Ubuntu 22.04

gcovr is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install gcovr using APT

This is one of the popular ways to install any Ubuntu packages because it is simple to understand, even if you are a Linux novice. Following these instructions to get gcovr on your Ubuntu.

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt -y update

Step 2: Install the package on Ubuntu 22.04. After updating the system, you can install gcovr Ubuntu by pasting this command into the terminal and executing it.

sudo apt install gcovr

Install gcovr using Aptitude

If you haven’t already installed Aptitude on Ubuntu, run this command to do so.

sudo apt -y install aptitude

After that, you can now install gcovr by following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing this Linux command:

sudo apt-get -y update

Step 2: Start the package installation on Ubuntu 22.04. You can now install gcovr Ubuntu by executing this command in the terminal.

sudo aptitude -y install gcovr

Uninstall gcovr on Ubuntu 22.04

Have you ever considered how challenging it might be to uninstall an application from Ubuntu? You’re wrong, anyone can easily uninstall any program, not just a gcovr.

You can uninstall gcovr on Ubuntu by running this command if you installed it using APT or Aptitude.

sudo apt remove --auto-remove gcovr

If you want to uninstall gcovr and remove its data and dependencies, you can also run the following command:

sudo apt autoremove --purge gcovr

Summary

In this guide, I showed you ways to install gcovr on Ubuntu 22.04 and some ways to uninstall gcovr too. Please do not hesitate to contact me if you require any assistance. I’m delighted to respond to them.