Created attachment 812884 [details, diff] ebuild.diff Trying to get UFW to run on a new install I was unable to start ufw without it erroring out. Searching around the forums I've seen some new users have this issue since Python 3.9 and later found installing pip fixes the issue on some Ubuntu forum. Before installing pip: user # ufw allow ssh ERROR: problem running After installing pip: user # ufw allow ssh Skipping adding existing rule Skipping adding existing rule (v6) I've included the fix for the ebuild but unsure if this requires an r2 release or not for this situation.
I can reproduce this with pip installed as below. Setup: # emerge --info pip | grep dev-python/pip -A1 dev-python/pip-22.2.2::gentoo was built with the following: USE="-test -vanilla" ABI_X86="(64)" PYTHON_TARGETS="python3_10 (-pypy3) (-python3_11) -python3_8 -python3_9" # find /etc/ufw find: ‘/etc/ufw’: No such file or directory # emerge -1 ufw These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild N ] net-firewall/ufw-0.36-r1::gentoo USE="ipv6 -examples" PYTHON_TARGETS="python3_10 -python3_8 -python3_9" 0 KiB Test: # ufw allow ssh ERROR: problem running # ufw allow ssh ERROR: problem running # ufw allow ssh Skipping adding existing rule Skipping adding existing rule (v6) Alternatively (after a clean setup): # ufw allow ssh ERROR: problem running # ufw enable Firewall is active and enabled on system startup # ufw status sudo ufw status Status: active To Action From -- ------ ---- 22 ALLOW Anywhere # ufw allow ssh Skipping adding existing rule Rule added (v6) # ufw status Status: active To Action From -- ------ ---- 22 ALLOW Anywhere 22 (v6) ALLOW Anywhere (v6) If you want to re-test you must (in this order): 1. ufw disable 2. Unmerge ufw 3. rm -rf /etc/ufw 4. Repeat the setup 5. Verify that ufw is inactive with `ufw status` In all cases, after ufw is enabled, the rules appear in IPTables, even if the original command caused an error. I think it occurs any time a rule is added for the first time for each of IPv4 and IPv6.
Looks you could be right and installing pip was unnecessary. I'll try this on a fresh machine to confirm as it might just need a wiki update rather than an ebuild update.
This now works fully with the instructions on the wiki article so closing as fixed.