尝试在 WSL 上安装 openssh-client openssh-server,但出现 snap 错误

尝试在 WSL 上安装 openssh-client openssh-server,但出现 snap 错误
sudo apt-get install openssh-client openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 squashfs-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  openssh-sftp-server ssh-import-id
Suggested packages:
  keychain libpam-ssh monkeysphere ssh-askpass molly-guard
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success

sudo apt auto remove 也会出现同样的错误

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success

答案1

不确定是什么原因导致了这个snap问题,但如果你不打算使用 snap,我建议从中删除 snap 集成apt

sudo rm /etc/apt/apt.conf.d/20snapd.conf

您可以找到相关问题这里

相关内容