How To Install gtest on Rocky Linux 8

In this tutorial we learn how to install gtest on Rocky Linux 8. gtest is Google C++ testing framework

Introduction

In this tutorial we learn how to install gtest on Rocky Linux 8.

What is gtest

Framework for writing C++ tests on a variety of platforms (GNU/Linux, Mac OS X, Windows, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, various options for running the tests, and XML test report generation.

We can use yum or dnf to install gtest on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install gtest.

Install gtest on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install gtest using dnf by running the following command:

sudo dnf -y install gtest

Install gtest on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install gtest using yum by running the following command:

sudo yum -y install gtest

How To Uninstall gtest on Rocky Linux 8

To uninstall only the gtest package we can use the following command:

sudo dnf remove gtest

gtest Package Contents on Rocky Linux 8

/usr/lib/.build-id
/usr/lib/.build-id/0b
/usr/lib/.build-id/0b/bc3eed9cda3f18825676ba3f7f9ae79b0fbabe
/usr/lib/.build-id/49
/usr/lib/.build-id/49/02e131b5d3094f9f520f85287a5ba9a24c76ff
/usr/lib/libgtest.so.1.8.0
/usr/lib/libgtest_main.so.1.8.0
/usr/share/licenses/gtest
/usr/share/licenses/gtest/LICENSE
/usr/lib/.build-id
/usr/lib/.build-id/97
/usr/lib/.build-id/97/f6fc5088e8ab780cdd987b4851eedf7d4b37c8
/usr/lib/.build-id/b3
/usr/lib/.build-id/b3/e61c15043dfc8fede67f077f24ad77577f174c
/usr/lib64/libgtest.so.1.8.0
/usr/lib64/libgtest_main.so.1.8.0
/usr/share/licenses/gtest
/usr/share/licenses/gtest/LICENSE

References

Summary

In this tutorial we learn how to install gtest on Rocky Linux 8 using yum and dnf.