linuxsnapcraft

snap is unusable due to missing files


today, i tried to start vscode. i type code in dmenu and press enter. nothing happens. i do it a few more times, still nothing. now i try to open it in my terminal. code. i get an error:

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

i try sudo snap refresh and hope for the best.

error: cannot perform the following tasks:
- Mount snap "core" (11420) (snap is unusable due to missing files; contact developer)

i guess i didn't hope well enough. i try to reinstall vscode:

sudo snap remove code
sudo snap install code

it uninstalled code, but when i tried to reinstall it, it greeted me with an error:

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.

thank god it wasn't something that would stop me from installing code.

sudo snap install --classic code

this should work.

error: cannot install "code": classic confinement requires snaps under /snap or symlink from /snap
       to /var/lib/snapd/snap

it doesn't.

i have given up, can someone please help me resolve this issue?

OS: Manjaro
Arch: x86_64
Kernel: 5.10.52-1-MANJARO

Solution

  • Have you tried creating the symlink mentioned in this?

    error: cannot install "code": classic confinement requires snaps under /snap or symlink from /snap
       to /var/lib/snapd/snap
    

    I've just had this same problem on manjaro as well, just had to make the symlink and then revert the package like so:

    sudo ln -s /var/lib/snapd/snap /snap
    snap revert code
    

    source: https://snapcraft.io/install/code/manjaro#snippet-distro-install-command-4