How To Install tmpreaper on Debian 12

Learn how to install tmpreaper on Debian 12 with this tutorial. tmpreaper is cleans up files in directories based on their age

Introduction

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

What is tmpreaper

tmpreaper is:

This package provides a program that can be used to clean out temporary-file directories. It recursively searches the directory, refusing to chdir() across symlinks, and removes files that haven’t been accessed in a user-specified amount of time. You can specify a set of files to protect from deletion with a shell pattern. It will not remove files owned by the process EUID that have the w' bit clear, unless you ask it to, much like rm -f’. `tmpreaper’ will not remove symlinks, sockets, fifos, or special files unless given a command line option enabling it to.

WARNING: Please do not run tmpreaper' on /’. There are no protections against this written into the program, as that would prevent it from functioning the way you’d expect it to in a `chroot(8)’ environment.

The daily tmpreaper run can be configured through /etc/tmpreaper.conf .

There are three methods to install tmpreaper 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 tmpreaper Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install tmpreaper

Install tmpreaper Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install tmpreaper

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

sudo aptitude -y install tmpreaper

How To Uninstall tmpreaper on Debian 12

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

sudo apt-get remove tmpreaper

Uninstall tmpreaper And Its Dependencies

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

sudo apt-get -y autoremove tmpreaper

Remove tmpreaper Configurations and Data

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

sudo apt-get -y purge tmpreaper

Remove tmpreaper configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge tmpreaper

Dependencies

tmpreaper have the following dependencies:

References

Summary

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