Can't uninstall docker from ubuntu 20.04

I have installed docker via snap, but through intellij (and other jetbrains products) it is casuing me this issue shown in the image below.

enter image description here

After this i tried to reinstall docker to solve the issue.

When i ran the following snap command to remove it

$ sudo snap remove docker 


----------------

error: cannot perform the following tasks:
- Disconnect docker:network-bind from snapd:network-bind (cannot update mount namespace of snap "docker": cannot update preserved namespace of snap "docker": cannot update snap namespace: remove /usr/share/git-core/templates: no such file or directory)

Does anybody have an idea of what could cause this issue. Seems the entire thing is corrupted and now i can't install nor uninstall...


Solution 1:

Just dealt with the same issue. I have no idea what caused it, but what worked for me was to disable Docker first before attempting to uninstall it.

sudo snap disable docker
sudo snap remove --purge docker