How To Install sccache on Debian 12

Learn how to install sccache on Debian 12 with this tutorial. sccache is compiler cache for fast recompilation of C/C++/Rust code

Introduction

In this tutorial we learn how to install sccache on Debian 12.

What is sccache

sccache is:

Sccache is a compiler cache. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again.

Compared to ccache, sccache caches not only C and C++ but also Rust code and can store its cache using certain cloud storage, but tracks objects by their full paths (ccache tracks objects more flexibly).

There are three methods to install sccache on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install sccache Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install sccache using apt-get by running the following command:

sudo apt-get -y install sccache

Install sccache Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install sccache using apt by running the following command:

sudo apt -y install sccache

Install sccache Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install sccache using aptitude by running the following command:

sudo aptitude -y install sccache

How To Uninstall sccache on Debian 12

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

sudo apt-get remove sccache

Uninstall sccache And Its Dependencies

To uninstall sccache and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove sccache

Remove sccache Configurations and Data

To remove sccache configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge sccache

Remove sccache configuration, data, and all of its dependencies

We can use the following command to remove sccache configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge sccache

Dependencies

sccache have the following dependencies:

References

Summary

In this tutorial we learn how to install sccache package on Debian 12 using different package management tools: apt, apt-get and aptitude.