Error on command snap install core

Install by instuction on:

but at step:

$ sudo snap install core
error: cannot communicate with server: Post http://localhost/v2/snaps/core: dial unix /run/snapd.socket: connect: no such file or directory

What actually the cause and its solution ?

The snapd service does not seem to be up. Can you check if it’s running? You can do that by executing systemctl status snapd.service

Solved now
after Snapd service’s turned on

I am trying to install “snap store” in Kali, but when I get to the point of putting " sudo snap install core" it gives me the following error:

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

I have tried the following command “systemctl status snapd.service” and it shows me the following message:

○ snapd.service - Snap Daemon Loaded: loaded (/lib/systemd/system/snapd.service; disabled; vendor preset: disabled) Active: inactive (dead) TriggeredBy: ○ snapd.socket

How can I solve this problem? I have tried the command "sudo snap start --enable lxd.daemon " and it shows me the following message:

error: cannot communicate with server: Post “http://localhost/v2/apps”: dial unix /run/snapd.socket: connect: no such file or directory

Thank you

Have you followed the instructions in https://snapcraft.io/docs/installing-snap-on-kali ?

Yes, I followed those instructions, now after repeating the entire process it has advanced a little more, but after completing the entire installation it does not show me the installed application.

if I put in the terminal “snap-store” it returns me: Command ‘snap-store’ is available in ‘/snap/bin/snap-store’ The command could not be located because ‘/snap/bin’ is not included in the PATH environment variable. snap-store: command not found

I don’t know if I can solve this error with this: export PATH="/snap/bin:$PATH"

If I put in the terminal “/snap/bin” it shows me this: mkdir: cannot create directory ‘/run/user/0’: Permission denied Warning: Schema “org.gnome.system.locale” has path “/system/locale/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated. Warning: Schema “org.gnome.system.proxy” has path “/system/proxy/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated. Warning: Schema “org.gnome.system.proxy.http” has path “/system/proxy/http/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated. Warning: Schema “org.gnome.system.proxy.https” has path “/system/proxy/https/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated. Warning: Schema “org.gnome.system.proxy.ftp” has path “/system/proxy/ftp/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated. Warning: Schema “org.gnome.system.proxy.socks” has path “/system/proxy/socks/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated. 16:53:57:0159 GLib-GIO g_app_info_get_name: assertion ‘G_IS_APP_INFO (appinfo)’ failed No protocol specified Unable to init server: Could not connect: Connection refused 16:53:57:0207 Gtk cannot open display: :0.0

In the location /snap/bin/ there is the store and some other applications that I have installed manually, without their own icons (they show a wheel) if I run them from there manually they do work, but I don’t know how I can do it. to detect them normally.

I am using kali usb version with persistence

if you freshly installed snapd you need to log out and back in to get these bits added to your PATH … the warning should just vanish after re-login …

are you trying to start this snap as root (desktop snaps are not designed for being run by root) ?

The issue has been “temporarily” fixed. I explain it

As I mentioned I am using Kali usb with persistence. After getting everything installed and after trying to modify the PATH, since the applications are installed in /snap/bin it worked correctly.

The problem is that when I restart the PATH it is lost, and the snap store and the applications installed with it are unconfigured, having to reconfigure the PATH and enter the following commands to make it work again:

1-sudo apparmor_parser -r /etc/apparmor.d/snap-confine

2-sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap-confine*

3-service snapd.apparmor start

If someone here can help me, I would appreciate it, although I am going to open another post with the problem since it does not fit the title of this post.

Thank you