How to Install Snort on Ubuntu 22.04


Snort is a widely used Linux-based network intrusion detection and prevention system that helps to safeguard networks against potential security threats including DoS attacks, malware, and port scans. Using signature-based detection and a customizable rule language, Snort can analyze network packets and identify potential threats, while features like packet logging, protocol analysis, and traffic analysis offer further insight.

In this post, we will elaborate on the following points:

  • Method 1: Installing Snort on Ubuntu 22.04 Using apt Manager
  • Method 2: Installing Snort on Ubuntu 22.04 Using apt-get Manager
  • Method 3: Installing Snort on Ubuntu 22.04 From Source Code
  • How to Remove/Uninstall Snort on Ubuntu 22.04?

Method 1: Installing Snort on Ubuntu 22.04 Using apt Manager

Debian-based Linux Distributions like Ubuntu 22.04 comes with a pre-installed packages manager “apt“. Basically, it is a command-line-based tool that is used to perform app-related operations like installation, updation, uninstallations, and so on. In this method, we will use apt to install Snort on our Ubuntu 22.04.

Step 1: Update apt packages

Hit “CTRL+ALT+T” to open up the terminal for updating the packages. Type out the mentioned command in the terminal:

sudo apt update

Step 2: Install Snort

To install Snort on Ubuntu 22.04, type out the mentioned command in the terminal:

sudo apt install snort -y

Note: The “y” command in the installation process sets “Yes” as the default response to any prompts that may come up.

Snort has been installed on Ubuntu 22.04.

Method 2: Installing Snort on Ubuntu 22.04 Using apt-get Manager

Just like apt, “apt-get” can also be utilized for installing, removing, updating, and searching software packages. We will use apt-get to install Snort on our Ubuntu 22.04.

Step 1: Update the packages

To update the packages using apt-get, open the terminal. Then, type the mentioned command:

sudo apt-get update

Step 2: Install Snort

For installing Snort on Ubuntu 22.04, write out the command below in the terminal:

sudo apt-get install snort -y

This prompt instructs that CIDR is the syntax for defining network addresses. Hit Enter to continue:

The network structure will automatically be detected by the installer. Verify if it is correct, else fix it. After that, Hit Enter:

Wait for the process to get completed:

Snort has been installed on Ubuntu 22.04.

Method 3: Installing Snort on Ubuntu 22.04 From Source Code

In this method, we will discuss how to manually install the specified version of Snort on Ubuntu 22.04 by compiling it from the source code.

Step 1: Install the Required Dependencies

For installing the required dependencies, write out the mentioned command in the terminal:

sudo apt install build-essential libpcap-dev libpcre3-dev libdumbnet-dev bison flex zlib1g-dev -y

Step 2: Download Snort

Download Snort by using the command below. Also, specify the Snort version you want to download. In our case, the Snort version is 2.9.20:

wget https://www.snort.org/downloads/snort/snort-2.9.20.tar.g

Wait until Snort gets downloaded:

After that, execute the following command in the terminal to extract the Snort’s tar file:

tar xvzf snort-2.9.20.tar.gz

Step 3: Change the directory

Next, navigate to the directory where the Snort installation file is located:

cd snort-2.9.20

Step 4: Install Snort

As the last step, Execute the command below in the terminal for installing Snort on Ubuntu 22.04:

 

./configure -enable-sourcefire && make sudo make install

Finally, Snort has been installed on Ubuntu 22.04.

How to Remove/Uninstall Snort on Ubuntu 22.04?

To remove Snort from your Ubuntu 22.04, write the following command in the terminal:

sudo apt-get remove --purge snort -y

Snort has been removed from Ubuntu 22.04.

Conclusion

For installing Snort on Ubuntu 22.04, you can use apt, apt-get, and you can install it from the source code as well. To install Snort using apt on Ubuntu 22.04, open up the terminal, and update the packages. After that, write “sudo apt install snort -y” in the terminal. Go through the guide to utilize the rest of the approaches.

Print Friendly, PDF & Email
Categories