我无法下载任何 snap 应用程序,甚至无法打开它。我正在使用最新版本的 Ubuntu LTS 22.04。
cannot communicate with server: Post "http://localhost/v2/snaps/code": dial unix /run/snapd.socket: connect: connection refused
当尝试检查systemctl
状态时:
systemctl status snapd
× snapd.service - Snap Daemon
Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-11-02 09:40:16 EAT; 5min ago
TriggeredBy: × snapd.socket
Process: 10272 ExecStart=/usr/lib/snapd/snapd (code=exited, status=1/FAILURE)
Main PID: 10272 (code=exited, status=1/FAILURE)
CPU: 447ms
Nov 02 09:40:16 rasjo-HP-Pavilion-Laptop-15-cc5xx systemd[1]: snapd.service: Scheduled restart job, restart counter is at 5.
Nov 02 09:40:16 rasjo-HP-Pavilion-Laptop-15-cc5xx systemd[1]: Stopped Snap Daemon.
Nov 02 09:40:16 rasjo-HP-Pavilion-Laptop-15-cc5xx systemd[1]: snapd.service: Start request repeated too quickly.
Nov 02 09:40:16 rasjo-HP-Pavilion-Laptop-15-cc5xx systemd[1]: snapd.service: Failed with result 'exit-code'.
Nov 02 09:40:16 rasjo-HP-Pavilion-Laptop-15-cc5xx systemd[1]: Failed to start Snap Daemon.
Nov 02 09:40:16 rasjo-HP-Pavilion-Laptop-15-cc5xx systemd[1]: snapd.service: Triggering OnFailure= dependencies.
答案1
警告:此解决方案将删除 snap 和所有通过 snap 安装的软件包!
您可以尝试重新安装snapd
:
sudo apt autoremove --purge snapd
sudo apt update
sudo apt upgrade
sudo apt install snapd
此后,您将必须重新安装所有快照。