Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 373
c8h_ Avatar asked Jul 29 '21 16:07

c8h_


People also ask

Where are snap programs stored?

A snap's installed applications can be found under /snap/bin , and subsequently, often added to $PATH. This makes commands directly accessible from the command line.

How do I fix snap command not found?

If you see the error: snap "package" not found , that suggests you already have snap support installed. The above message indicates that the package name you entered into the command could not be located in the snap repositories. If you see this error, use the find command to double-check the package name.


Video Answer


2 Answers

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

like image 161
Well147 Avatar answered Oct 22 '22 01:10

Well147


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.

like image 22
user2536844 Avatar answered Oct 22 '22 00:10

user2536844