本文主要介绍Linux中,使用vscode时,snapcraft报错:error: cannot perform the following tasks: - Mount snap “core” (11420) (snap is unusable due to missing files; contact developer)的解决方法。

使用vscode和执行sudo snap refresh命令出错:

报错信息:

/var/lib/snapd/snap/code/70/command-code.wrapper: line 2: /snap/code/70/electron-launch: No such file or directory

尝试重新安装命令

sudo snap remove code
sudo snap install code
sudo snap install --classic 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 ln -s /var/lib/snapd/snap /snap
snap revert code

参考文档https://snapcraft.io/install/code/manjaro#snippet-distro-install-command-4


推荐文档