问题描述
今天,我尝试启动 vscode。我在 dmenu 中输入 code
并按回车键。什么都没发生。我又做了几次,仍然没有。现在我尝试在我的终端中打开它。 code
。我收到一个错误:
/var/lib/snapd/snap/code/70/command-code.wrapper: line 2: /snap/code/70/electron-launch: No such file or directory
我尝试了 sudo snap refresh
并希望一切顺利。
error: cannot perform the following tasks:
- Mount snap "core" (11420) (snap is unusable due to missing files; contact developer)
我想我的希望还不够好。 我尝试重新安装 vscode:
sudo snap remove code
sudo snap install code
它卸载了 code
,但是当我尝试重新安装它时,它向我致意:
error: This revision of snap "code" was published using classic confinement and thus may perform
arbitrary system changes outside of the security sandBox that snaps are usually confined to,which may put your system at risk.
If you understand and want to proceed repeat the command including --classic.
感谢上帝,这不会阻止我安装代码。
sudo snap install --classic code
这应该有效。
error: cannot install "code": classic confinement requires snaps under /snap or symlink from /snap
to /var/lib/snapd/snap
没有。
我已经放弃了,有人可以帮我解决这个问题吗?
OS: manjaro
Arch: x86_64
Kernel: 5.10.52-1-manjaro
解决方法
您是否尝试过创建此处提到的符号链接?
error: cannot install "code": classic confinement requires snaps under /snap or symlink from /snap
to /var/lib/snapd/snap
我刚刚在 manjaro 上也遇到了同样的问题,只需要创建符号链接,然后像这样还原包:
sudo ln -s /var/lib/snapd/snap /snap
snap revert code
来源:https://snapcraft.io/install/code/manjaro#snippet-distro-install-command-4