How To Install ccache on AlmaLinux 8

In this tutorial we learn how to install ccache in AlmaLinux 8. ccache is C/C++ compiler cache

Introduction

In this tutorial we learn how to install ccache on AlmaLinux 8.

What is ccache

ccache is a compiler cache. It speeds up recompilation of C/C++ code by caching previous compiles and detecting when the same compile is being done again. The main focus is to handle the GNU C/C++ compiler (GCC), but it may also work with compilers that mimic GCC good enough.

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

Install ccache on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install ccache

Install ccache on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install ccache

How To Uninstall ccache on AlmaLinux 8

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

sudo dnf remove ccache

References

Summary

In this tutorial we learn how to install ccache on AlmaLinux 8 using yum and dnf.