How to Uninstall or Install modsecurity-crs on Ubuntu 22.04

Updated: October 9, 2022

modsecurity provides critical protections against attacks across most every web architecture. CRS is based on generic rules which focus on attack payload identification in order to provide protection from zero day and unknown vulnerabilities often found in web applications, which are in most cases custom coded. In this guide, I will show you ways to install modsecurity-crs Ubuntu 22.04.

Software Requirement

  • Operating system: Ubuntu 22.04 is needed for modsecurity-crs to work
  • Privileges: Ensure that you are able to execute the sudo commands line.

Prerequisites to install modsecurity-crs on Ubuntu 22.04

Install modsecurity-crs Ubuntu 22.04

modsecurity-crs is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one that you think is easy and you can follow.

Install modsecurity-crs using APT

This is a popular method for installing Ubuntu packages because it’s easy to follow, even if you are a newbie in Linux. Following these steps to install modsecurity-crs on your Ubuntu 22.04.

Step 1: Update the APT database to download new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt -y update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install modsecurity-crs Ubuntu by pasting this command into the terminal and executing it.

sudo apt-get -y install modsecurity-crs

Install modsecurity-crs using Aptitude

Aptitude allows users to view a list of available packages and manage package installation, upgrade, and removal. If you haven’t already done so, run this command to install it.

sudo apt-get install aptitude

Then, you can now install modsecurity-crs by following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Launch the terminal and enter the following Linux command:

sudo apt-get -y update

Step 2: Start the package installation on Ubuntu 22.04. You can now install modsecurity-crs Ubuntu by executing this command in the terminal.

sudo aptitude install modsecurity-crs

Uninstall modsecurity-crs on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu is difficult? You are mistaken; Anyone can easily uninstall any program, not just modsecurity-crs.

If you installed modsecurity-crs using APT or Aptitude, you could uninstall modsecurity-crs on Ubuntu by following this step:

sudo apt remove --auto-remove modsecurity-crs

You can also execute this command if you want to uninstall modsecurity-crs and remove its data and dependencies:

sudo apt autoremove --purge modsecurity-crs


In this guide, I showed you ways to install modsecurity-crs on Ubuntu 22.04 and some ways to uninstall modsecurity-crs too. Please do not hesitate to contact me if you require assistance. I’m delighted to respond.