How To Install cppcheck on Rocky Linux 8

In this tutorial we learn how to install cppcheck on Rocky Linux 8. cppcheck is Tool for static C/C++ code analysis

Introduction

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

What is cppcheck

Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools it does not detect syntax errors in the code. Cppcheck primarily detects the types of bugs that the compilers normally do not detect. The goal is to detect only real errors in the code (i.e. have zero false positives).

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

Install cppcheck 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 cppcheck using dnf by running the following command:

sudo dnf -y install cppcheck

Install cppcheck 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 cppcheck using yum by running the following command:

sudo yum -y install cppcheck

How To Uninstall cppcheck on Rocky Linux 8

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

sudo dnf remove cppcheck

cppcheck Package Contents on Rocky Linux 8

/usr/bin/cppcheck
/usr/lib/.build-id
/usr/lib/.build-id/a3
/usr/lib/.build-id/a3/5031cc6a75652bc1a7384b995dad8a6ee1259f
/usr/share/CppCheck
/usr/share/CppCheck/avr.cfg
/usr/share/CppCheck/bsd.cfg
/usr/share/CppCheck/cppcheck-lib.cfg
/usr/share/CppCheck/embedded_sql.cfg
/usr/share/CppCheck/gnu.cfg
/usr/share/CppCheck/gtk.cfg
/usr/share/CppCheck/lang
/usr/share/CppCheck/lang/cppcheck_de.qm
/usr/share/CppCheck/lang/cppcheck_es.qm
/usr/share/CppCheck/lang/cppcheck_fi.qm
/usr/share/CppCheck/lang/cppcheck_fr.qm
/usr/share/CppCheck/lang/cppcheck_it.qm
/usr/share/CppCheck/lang/cppcheck_ja.qm
/usr/share/CppCheck/lang/cppcheck_ko.qm
/usr/share/CppCheck/lang/cppcheck_nl.qm
/usr/share/CppCheck/lang/cppcheck_ru.qm
/usr/share/CppCheck/lang/cppcheck_sr.qm
/usr/share/CppCheck/lang/cppcheck_sv.qm
/usr/share/CppCheck/lang/cppcheck_zh_CN.qm
/usr/share/CppCheck/microsoft_sal.cfg
/usr/share/CppCheck/motif.cfg
/usr/share/CppCheck/posix.cfg
/usr/share/CppCheck/qt.cfg
/usr/share/CppCheck/sdl.cfg
/usr/share/CppCheck/sfml.cfg
/usr/share/CppCheck/std.cfg
/usr/share/CppCheck/windows.cfg
/usr/share/CppCheck/wxwidgets.cfg
/usr/share/doc/cppcheck
/usr/share/doc/cppcheck/AUTHORS
/usr/share/doc/cppcheck/COPYING
/usr/share/doc/cppcheck/manual.html
/usr/share/man/man1/cppcheck.1.gz

References

Summary

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