How To Install libmodsecurity3 on Debian 12

Learn how to install libmodsecurity3 on Debian 12 with this tutorial. libmodsecurity3 is ModSecurity v3 library component

Introduction

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

What is libmodsecurity3

libmodsecurity3 is:

Libmodsecurity is one component of the ModSecurity v3 project. The library codebase serves as an interface to ModSecurity Connectors taking in web traffic and applying traditional ModSecurity processing. In general, it provides the capability to load/interpret rules written in the ModSecurity SecRules format and apply them to HTTP content provided by your application via Connectors.

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

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

sudo apt-get update

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

sudo apt-get -y install libmodsecurity3

Install libmodsecurity3 Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libmodsecurity3

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

sudo aptitude -y install libmodsecurity3

How To Uninstall libmodsecurity3 on Debian 12

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

sudo apt-get remove libmodsecurity3

Uninstall libmodsecurity3 And Its Dependencies

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

sudo apt-get -y autoremove libmodsecurity3

Remove libmodsecurity3 Configurations and Data

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

sudo apt-get -y purge libmodsecurity3

Remove libmodsecurity3 configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libmodsecurity3

Dependencies

libmodsecurity3 have the following dependencies:

References

Summary

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