If after installing the SNAPD on Ubuntu, Kali, or other Linux you will get an error:
solve error: cannot communicate with server: Post "http://localhost/v2/snaps/": dial unix /run/snapd.socket: connect: no such file or directory
Then this is because, after installation, the Daemon of SNAP is have not started yet and needs to start and enable manually by the user.
Therefore to resolve such an issue perform the below steps after installing snapd.
First, check the status of SNAPD service
systemctl status snapd.service
If you get the following output then the service is not yet started.
● snapd.service - Snap Daemon Loaded: loaded (/lib/systemd/system/snapd.service; disabled; vendor p> Active: inactive (dead) TriggeredBy: ● snapd.socket
Start SNAPD service
systemctl start snapd
systemctl status snapd
Output ● snapd.service - Snap Daemon Loaded: loaded (/lib/systemd/system/snapd.service; disabled; vendor p> Active: active (running) since Thu 2020-11-26 06:33:26 EST; 1s ago TriggeredBy: ● snapd.socket Main PID: 2338 (snapd) Tasks: 8 (limit: 4623) Memory: 22.8M CGroup: /system.slice/snapd.service └─2338 /usr/lib/snapd/snapd
In case still the error hasn’t solved yet, then run the below command. However, it will remove any existing installed application via snap.
sudo apt purge snapd sudo apt install snapd