so this is unlikely to work unless you can either fully enable systemd on MX or provide some MX specific snapd changes similar to to the ones used on ubuntu 14.04 where the systemd-shim was still in use …
I am adding the command I ran in case it helps anyone.
sudo systemctl enable --now snapd.socket
Overview:
1.
sudo apt install snapd
sudo snap install notepad-plus-plus
error: cannot communicate with server: Post “http://localhost/v2/snaps/notepad-plus-plus”: dial unix /run/snapd.socket: connect: no such file or directory
3
snap version 1 ⨯
snap 2.49-1+b4
snapd unavailable
series -
4
sudo systemctl enable --now snapd.socket
5
snap version
snap 2.49-1+b4
snapd 2.49-1+b4
series 16
kali 2021.2
kernel 5.10.0-kali8-amd64
6
sudo snap install notepad-plus-plus
Everything is working now.
OS is Kali GNU/Linux Rolling with kernel Linux 5.10.0-kali8-amd64
As told by @ogra the snapd.service is inactive to solve the error run the following commands systemctl start snapd.service
and then try to install the package with snap, in my case it was. sudo snap install libreoffice
This issue came to me because i changed permission to 777
I searched every where and I find only this solution is best
sudo apt-get purge snapd
sudo apt-get install snapd
I had the same problem and what I did was to reinstall snap and one more configure, I think I made a mistake when installing snap, installing it this way.
sudo apt-get install snap
Or that was my mistake, because the correct way to install snap was or that happens in my case:
sudo zypper install snapd
[sudo] password for root:
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following NEW package is going to be installed:
snapd
1 new package to install.
Overall download size: 16.4 MiB. Already cached: 0 B. After the operation, additional 64.4 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving: snapd-2.59.5-1.23.x86_64 (snappy) (1/1), 16.4 MiB
Retrieving: snapd-2.59.5-1.23.x86_64.rpm .................................................................................................................................................................................................................................................................[done (1.3 MiB/s)]
Checking for file conflicts: .........................................................................................................................................................................................................................................................................................[done]
/usr/libexec/snapd/snap-confine: no configuration entry in active permission profiles found. Cannot check this path.
Please reboot, logout/login or source /etc/profile to have /snap/bin added to PATH.
On a Tumbleweed and Leap 15.3+ systems you need to run: systemctl enable snapd.apparmor.service
(1/1) Installing: snapd-2.59.5-1.23.x86_64 ...........................................................................................................................................................................................................................................................................[done]
RokeJulianLockhart@s1e8h4:~> systemctl enable snapd.apparmor.service
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.apparmor.service → /usr/lib/systemd/system/snapd.apparmor.service.
RokeJulianLockhart@s1e8h4:~> sudo snap install icq-im --edge
error: cannot communicate with server: Post "http://localhost/v2/snaps/icq-im": dial unix /run/snapd.socket: connect: connection refused
ubuntu@localhost:~$ snap install firefox error: cannot communicate with server: Post “http://localhost/v2/snaps/firefox”: dial unix /run/snapd.socket: connect: no such file or directory
ubuntu@localhost:~$ snap version
snap 2.61.3+23.10
snapd unavailable
series -
ubuntu@localhost:~$ sudo systemctl enable --now snapd.socket System has not been booted with systemd as init system (PID 1). Can’t operate. Failed to connect to bus: Host is down
ubuntu@localhost:~$ snap version
snap 2.61.3+23.10
snapd unavailable
series -
How did you get into this state ? systemd is indeed a hard requirement for snap packages to work at all, what OS are you running over there ? (apparently snap version does not even find an /etc/os-release file to determine the OS)
so I think I have to reinstall the full process if there any other way without reinstalling this system please let me know I have spend more than 3 hours in installing and more than 4 hours to find out what the problem is and still didn’t get any way to solve it
Your kernel needs to use all ubuntu patches and needs to use the exact ubuntu defconfig, else you will miss support for certain snap features on the kernel side … the kernel " Kernel: 6.2.1-PRoot-Distro" is definitely not from the ubuntu archive, so make sure all ubuntu “sauce” patches are applied first and make sure to use the generic ubuntu defconfig when building it.
additionally as i said above already, your system needs to be a fully functional ubuntu install which includes using systemd as your init system and having the apparmor userspace properly functional.
Also, it would make some sense to not hijack old resolved threads for this but instead open a new one as your problem seems to not be related to the original issue at all but to the fact that you have not a proper install at all.