How To Install python3-firewall on CentOS 8

python3-firewall is Python3 bindings for firewalld

Introduction

In this tutorial we learn how to install python3-firewall on CentOS 8.

What is python3-firewall

Python3 bindings for firewalld.

We can use yum or dnf to install python3-firewall on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install python3-firewall.

Install python3-firewall on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install python3-firewall using dnf by running the following command:

sudo dnf -y install python3-firewall

Install python3-firewall on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install python3-firewall using yum by running the following command:

sudo yum -y install python3-firewall

How To Uninstall python3-firewall on CentOS 8

To uninstall only the python3-firewall package we can use the following command:

sudo dnf remove python3-firewall

python3-firewall Package Contents on CentOS 8

/usr/lib/python3.6/site-packages/firewall
/usr/lib/python3.6/site-packages/firewall/__init__.py
/usr/lib/python3.6/site-packages/firewall/__pycache__
/usr/lib/python3.6/site-packages/firewall/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/client.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/client.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/command.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/command.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/dbus_utils.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/dbus_utils.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/errors.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/errors.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/functions.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/functions.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/fw_types.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/__pycache__/fw_types.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/client.py
/usr/lib/python3.6/site-packages/firewall/command.py
/usr/lib/python3.6/site-packages/firewall/config
/usr/lib/python3.6/site-packages/firewall/config/__init__.py
/usr/lib/python3.6/site-packages/firewall/config/__pycache__
/usr/lib/python3.6/site-packages/firewall/config/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/config/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/config/__pycache__/dbus.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/config/__pycache__/dbus.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/config/dbus.py
/usr/lib/python3.6/site-packages/firewall/core
/usr/lib/python3.6/site-packages/firewall/core/__init__.py
/usr/lib/python3.6/site-packages/firewall/core/__pycache__
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/base.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/base.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/ebtables.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/ebtables.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_config.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_config.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_direct.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_direct.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_helper.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_helper.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_icmptype.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_icmptype.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_ifcfg.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_ifcfg.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_ipset.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_ipset.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_nm.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_nm.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_policies.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_policies.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_service.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_service.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_transaction.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_transaction.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_zone.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/fw_zone.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/helper.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/helper.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/icmp.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/icmp.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/ipXtables.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/ipXtables.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/ipset.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/ipset.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/logger.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/logger.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/modules.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/modules.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/nftables.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/nftables.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/prog.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/prog.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/rich.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/rich.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/watcher.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/__pycache__/watcher.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/base.py
/usr/lib/python3.6/site-packages/firewall/core/ebtables.py
/usr/lib/python3.6/site-packages/firewall/core/fw.py
/usr/lib/python3.6/site-packages/firewall/core/fw_config.py
/usr/lib/python3.6/site-packages/firewall/core/fw_direct.py
/usr/lib/python3.6/site-packages/firewall/core/fw_helper.py
/usr/lib/python3.6/site-packages/firewall/core/fw_icmptype.py
/usr/lib/python3.6/site-packages/firewall/core/fw_ifcfg.py
/usr/lib/python3.6/site-packages/firewall/core/fw_ipset.py
/usr/lib/python3.6/site-packages/firewall/core/fw_nm.py
/usr/lib/python3.6/site-packages/firewall/core/fw_policies.py
/usr/lib/python3.6/site-packages/firewall/core/fw_service.py
/usr/lib/python3.6/site-packages/firewall/core/fw_transaction.py
/usr/lib/python3.6/site-packages/firewall/core/fw_zone.py
/usr/lib/python3.6/site-packages/firewall/core/helper.py
/usr/lib/python3.6/site-packages/firewall/core/icmp.py
/usr/lib/python3.6/site-packages/firewall/core/io
/usr/lib/python3.6/site-packages/firewall/core/io/__init__.py
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/direct.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/direct.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/firewalld_conf.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/firewalld_conf.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/functions.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/functions.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/helper.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/helper.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/icmptype.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/icmptype.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/ifcfg.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/ifcfg.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/io_object.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/io_object.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/ipset.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/ipset.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/lockdown_whitelist.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/lockdown_whitelist.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/service.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/service.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/zone.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/__pycache__/zone.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/core/io/direct.py
/usr/lib/python3.6/site-packages/firewall/core/io/firewalld_conf.py
/usr/lib/python3.6/site-packages/firewall/core/io/functions.py
/usr/lib/python3.6/site-packages/firewall/core/io/helper.py
/usr/lib/python3.6/site-packages/firewall/core/io/icmptype.py
/usr/lib/python3.6/site-packages/firewall/core/io/ifcfg.py
/usr/lib/python3.6/site-packages/firewall/core/io/io_object.py
/usr/lib/python3.6/site-packages/firewall/core/io/ipset.py
/usr/lib/python3.6/site-packages/firewall/core/io/lockdown_whitelist.py
/usr/lib/python3.6/site-packages/firewall/core/io/service.py
/usr/lib/python3.6/site-packages/firewall/core/io/zone.py
/usr/lib/python3.6/site-packages/firewall/core/ipXtables.py
/usr/lib/python3.6/site-packages/firewall/core/ipset.py
/usr/lib/python3.6/site-packages/firewall/core/logger.py
/usr/lib/python3.6/site-packages/firewall/core/modules.py
/usr/lib/python3.6/site-packages/firewall/core/nftables.py
/usr/lib/python3.6/site-packages/firewall/core/prog.py
/usr/lib/python3.6/site-packages/firewall/core/rich.py
/usr/lib/python3.6/site-packages/firewall/core/watcher.py
/usr/lib/python3.6/site-packages/firewall/dbus_utils.py
/usr/lib/python3.6/site-packages/firewall/errors.py
/usr/lib/python3.6/site-packages/firewall/functions.py
/usr/lib/python3.6/site-packages/firewall/fw_types.py
/usr/lib/python3.6/site-packages/firewall/server
/usr/lib/python3.6/site-packages/firewall/server/__init__.py
/usr/lib/python3.6/site-packages/firewall/server/__pycache__
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_helper.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_helper.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_icmptype.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_icmptype.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_ipset.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_ipset.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_service.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_service.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_zone.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/config_zone.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/decorators.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/decorators.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/firewalld.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/firewalld.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/server.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/firewall/server/__pycache__/server.cpython-36.pyc
/usr/lib/python3.6/site-packages/firewall/server/config.py
/usr/lib/python3.6/site-packages/firewall/server/config_helper.py
/usr/lib/python3.6/site-packages/firewall/server/config_icmptype.py
/usr/lib/python3.6/site-packages/firewall/server/config_ipset.py
/usr/lib/python3.6/site-packages/firewall/server/config_service.py
/usr/lib/python3.6/site-packages/firewall/server/config_zone.py
/usr/lib/python3.6/site-packages/firewall/server/decorators.py
/usr/lib/python3.6/site-packages/firewall/server/firewalld.py
/usr/lib/python3.6/site-packages/firewall/server/server.py

References

Summary

In this tutorial we learn how to install python3-firewall on CentOS 8 using yum and dnf.