Firewall rules not being added to UFW in ubuntu

As root:

apt install --reinstall ampinstmgr
ampinstmgr updatefirewall