16.04 – Snapd isn’t working

I want to install intellij idea. I tried:

sudo snap install intellij-idea-community --classic 
[sudo] password for user-1099869:  
error: cannot communicate with server: 
Post http://localhost/v2/snaps/intellij-idea-community: 
dial unixtr /run/snapd.socket: connect: no such file or directory

I’d posted abut this before and was told to reinstall snapd.

I did

sudo apt autoremove --purge snapd

Then

$ sudo apt update
$ sudo apt install snapd

I tested the hello world snapd. Got the same error as before:

error: cannot communicate with server: 
Post http://localhost/v2/snaps/hello-world: 
dial unix /run/snapd.socket: connect: no such file or directory