How to Uninstall and Install shorewall on Ubuntu 22.04

Updated: September 22, 2022

Shorewall allows firewall/gateway requirements to be described using entries in a set of configuration files. It reads those configuration files and, with the help of the iptables utility, configures netfilter to match these requirements. In this tutorial, I will show you how to install shorewall on Ubuntu 22.04.

Software Requirement

  • OS: Ubuntu 22.04 is needed for shorewall to work
  • Privileges: Ascertain that you are able to execute sudo commands.

Prerequisites to install shorewall on Ubuntu 22.04

Install shorewall Ubuntu 22.04

shorewall 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 you believe is simple and easy to follow.

Install shorewall using APT

This is a popular method for installing Ubuntu packages since it’s simple to understand, even if you’re new to Linux. Following these steps to get shorewall on your Ubuntu.

Step 1: Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing this Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating, you can install shorewall Ubuntu by executing this command in the terminal.

sudo apt-get -y install shorewall

Install shorewall using Aptitude

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

sudo apt-get install aptitude

Then, you can now install shorewall 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 download new packages from Ubuntu. Launch the terminal and enter the following Linux command:

sudo apt -y update

Step 2: Install the package on Ubuntu 22.04. After updating the system, you can now install shorewall Ubuntu by pasting this command into the terminal and pressing Enter.

sudo aptitude -y install shorewall

Uninstall shorewall 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 shorewall.

You can uninstall shorewall Ubuntu by running this command if you installed it using APT or Aptitude.

sudo apt remove --auto-remove shorewall

If you want to uninstall shorewall and delete its data and dependencies, you can also run the following command:

sudo apt autoremove --purge shorewall


In this guide, I showed you ways to install shorewall on Ubuntu 22.04 and some ways to uninstall shorewall too. Please contact me if you require any assistance. I’d be delighted to respond.