Ways to Install and Uninstall firewalld on Ubuntu 22.04

Updated: September 19, 2022

firewalld is a dynamically managed firewall daemon with support for network/firewall zones to define the trust level of network connections or interfaces. It has support for IPv4, IPv6 firewall settings and for ethernet bridges and has a separation of runtime and persistent configuration options. It also provides a D-Bus interface for services or applications to add and apply firewall rules on-the-fly. In this guide, I will show you how to install firewalld on Ubuntu 22.04.

Prerequisites to install

  • OS: Ubuntu 22.04 is needed for firewalld to work
  • Privileges: Make sure you are able to execute sudo commands.

Prerequisites to install firewalld on Ubuntu 22.04

Install firewalld Ubuntu 22.04

firewalld is one of the popular ways on Ubuntu now so that this tutorial will show you some ways to install it. Choose the one that you think is easy and you can follow.

Install firewalld using APT

This is one of the most popular methods for installing Ubuntu packages since it is simple to understand, even if you are a Linux novice. Following these instructions to install firewalld on your Ubuntu 22.04.

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. Launching the terminal and entering the following Linux command:

sudo apt-get update

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

sudo apt-get -y install firewalld

Install firewalld 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 -y install aptitude

After installing aptitude, you can now install firewalld, just following these steps:

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing this Linux command:

sudo apt -y update

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

sudo aptitude install firewalld

Uninstall firewalld on Ubuntu 22.04

Have you ever considered how challenging it might be to uninstall an application from Ubuntu? You’re wrong, anyone can easily uninstall any program, not just a firewalld.

If you installed firewalld using APT or Aptitude, you could uninstall firewalld on Ubuntu by running this command

sudo apt remove --auto-remove firewalld

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

sudo apt autoremove --purge firewalld

Conclusion

In this tutorial, I showed you ways to install firewalld on Ubuntu 22.04 and some ways to uninstall firewalld too. If you need any help, don’t hesitate to contact me. I’m very glad to answer them.