I have installed ufw and gufw in Ubuntu 18.04 with XFce4.12 environment. I was exploring its configurations, then I looked for some tutorials to configure it and when I run sudo ufw it returns this to me:

ERROR: not enough args

Then I run:

$ sudo ufw enable
Traceback (most recent call last):
  File "/usr/sbin/ufw", line 115, in <module>
  File "/usr/lib/python3/dist-packages/ufw/frontend.py", line 165, in __init__
  File "/usr/lib/python3/dist-packages/ufw/backend_iptables.py", line 51, in __init__
    rootdir=rootdir, datadir=datadir)
  File "/usr/lib/python3/dist-packages/ufw/backend.py", line 54, in __init__
  File "/usr/lib/python3/dist-packages/ufw/backend.py", line 288, in _get_defaults
    for line in orig:
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xac in position 4: invalid start byte

I can no longer start it, I have uninstalled and reinstalled it and it remains the same, any help please?

  • How do you install ufw ? I think it's came preinstalled (?) CMIIW
    – Liso
    May 20, 2020 at 1:52
  • yes, it comes installed, I only installed gufw which is the graphical interface of ufw. but when it gave me that error I uninstalled them both and reinstalled them. May 20, 2020 at 3:10
  • The ufw-command always requires arguments according to man ufw, so if you run sudo ufw you will always get ERROR: not enough args. But the error yout get with sudo ufw enable matters.
    – mook765
    May 20, 2020 at 5:03

1 Answer 1


It's true, ufw always has to have a command below either enable, disable, status etc.
Now I reply:

Previously I uninstalled them with:

$ sudo apt-get remove ufw gufw (which did not solve the issue)

But now I'm have solved it in the following way:

$ sudo apt-get purge ufw gufw

I have uninstalled them with the purge command, which according to I saw clean the configurations.

Then I reinstalled them:

$ sudo apt-get install ufw gufw

done !!! it's working again

Thanks a lot😉

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.