GUFW Firewall not opening

I’m having an issue with the GUFW Firewall on my new Manjaro KDE installation. When I start it and type in my password, it does nothing, just doesn’t start. When I tried typing “sudo gufw” into the terminal, I got this output:

“/usr/bin/gufw: line 2: [: =: unary operator expected”

Does anybody know how to fix this?

Let’s make sure you have read this first:
https://wiki.manjaro.org/index.php?title=Firewalls

So, is the ufw service enabled?
Did you avoid using iptables in that case?

Please don’t do that. You could eventually try:
gufw-pkexec

If ufw is enabled and running, it might be the issue with /usr/bin/gufw-pkexec

Please read: FS#66556 : [gufw] Gufw won't start

Has _G_UFW not fixed itself?
It used to do some silly legacy stuff that didnt jive and you needed to manually augment for display source and polkit and such … is it still like that ?
(old forum has handful of my own posts on the subject directly)

2 Likes

I found that my firewall settings also don’t work. After clicking on the firewall settings application in manjaro Gnome, I am prompted to enter the password, but then nothing happens.

I tried to modify the file: / bin / gufw - I added the text:
gksudo python3 /usr/lib/python3.7/site-packages/gufw/gufw.py

This method does not work. Please, how to solve the problem? Thank you

OK I found it …

Comment out the last line of /usr/bin/gufw and add a new one, so it looks like this on the last 2 lines:

#pkexec gufw-pkexec $c_user
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gufw-pkexec $c_user

And all is good.

There is still the bug referenced FS#66556 : [gufw] Gufw won't start

It is an error with /usr/bin/gufw-pkexec file under certain languages. The following is a quick fix.
This time its the first line of the script we want to comment out and replace. The top 3 lines would become:

#!/bin/bash
#LOCATIONS=`ls -ld /usr/lib/python*/site-packages/gufw/gufw.py | awk '{print $9}'` # from source
LOCATIONS=`echo /usr/lib/python*/site-packages/gufw/gufw.py`                      # from cscs
2 Likes

@oircz @mkey

Patched gufw package is now moving through Unstable and Testing branches.
Should see fixes in Stable branch on next round of updates.

1 Like