“Snap Find Package”后出现服务器错误

“Snap Find Package”后出现服务器错误

我的 Kubuntu 16.04 出现问题,因为以下命令不起作用:

$ snap find test
error: cannot list snaps: cannot communicate with server: Get http://localhost/v2/find?q=test: dial unix /run/snapd.socket: connect: no such file or directory

没有/run/snapd.socket文件,我尝试重新安装 snap 包。

有人知道可能出了什么问题吗?

编辑:

$ sudo systemctl status snapd.s*
Failed to list units: No such method 'ListUnitsFiltered'
Failed to expand names: Invalid request descriptor

$ systemctl status snapd.service snapd.socket
Failed to get properties: No such interface ''


$ ls /lib/systemd/system/snap*; echo; systemctl list-unit-files | grep snap; echo; dpkg -L snapd | grep systemd; echo; pgrep -a snap
/lib/systemd/system/snapd.frameworks-pre.target  /lib/systemd/system/snapd.refresh.service  /lib/systemd/system/snapd.service
/lib/systemd/system/snapd.frameworks.target      /lib/systemd/system/snapd.refresh.timer    /lib/systemd/system/snapd.socket

snapd.refresh.service                      static  
snapd.service                              enabled 
snapd.socket                               enabled 
snapd.frameworks-pre.target                static  
snapd.frameworks.target                    static  
snapd.refresh.timer                        enabled 

/lib/systemd
/lib/systemd/system
/lib/systemd/system/snapd.service
/lib/systemd/system/snapd.frameworks.target
/lib/systemd/system/snapd.socket
/lib/systemd/system/snapd.frameworks-pre.target
/lib/systemd/system/snapd.refresh.timer
/lib/systemd/system/snapd.refresh.service

答案1

确保服务正在运行

systemctl status snapd.service

如果没有则运行它

service snap start

那么你应该没问题了(如果服务没有启动,请尝试使用 sudo)

答案2

我遇到了同样的问题,服务没有运行,但我不知道为什么。在 ubuntu 16.04 服务器上,我不得不apt install snapd

~# snap --version
snap    2.34.2
snapd   unavailable
series  -

~# systemctl start snapd
Job for snapd.service failed because the control process exited with error code. See "systemctl status snapd.service" and "journalctl -xe" for details.

~$ systemctl status snapd.service
● snapd.service - Snappy daemon
   Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since sam. 2018-08-04 12:38:48 CEST; 6s ago
  Process: 1315 ExecStart=/usr/lib/snapd/snapd (code=exited, status=1/FAILURE)
 Main PID: 1315 (code=exited, status=1/FAILURE)

我在日志中发现该问题与以下内容有关squashfs

cannot start snapd: cannot mount squashfs image using "squashfs": mount: unknown filesystem type 'squashfs'

我正在使用kimsufiOVH 的服务器,发现自定义 OVH 内核不支持 squashfs。我切换到官方 ubuntu 内核,现在可以正常工作了!

相关内容