8

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
c8h_
  • 143
  • 1
  • 9

2 Answers2

11

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

Well147
  • 126
  • 1
  • 3
  • i tried that after i posted this. no luck, thought i did notice the actual symlink is at /snap/snap which is weird but probably normal behaviour. EDIT: just read the link you showed me, it told me to log out and log back in. i will try that. EDIT 2: I am currently accessing my computer through ssh so i'm not exactly sure i can safely log out of my wm from there – c8h_ Jul 30 '21 at 09:07
  • i still get the symlink error. even after a restart. but my symlink appears to be in /snap/snap instead of /snap. i have not been able to resolve this issue. EDIT: *it worked*. thanks for the help. – c8h_ Jul 30 '21 at 14:42
1

Short answer: Because of version incompatibility, you can try downgrading the following package (tested on Fedora 34):

sudo dnf install squashfs-tools-4.4-5.git1.fc34

Long answer:

It seems that because of this (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993233), snapd is unusable. So the workaround is to downgrading the squashfs package to fix the problem.

If it helps, I tried to install pycharm on Fedora (https://snapcraft.io/install/pycharm-professional/fedora#install) and the error appeared because of that bug.