Hello-world: readlink /snap/hello-world/current: no such file or directory

I messed up permissions after finding a problem with docker installed via snap. I run sudo aa-remove-unknown command and hell break loose all snaps except for classic installations are broken as shown below:

0ad 592 latest/stable play0ad✓ broken acestreamplayer 12 latest/stable vasilisc broken bare 5 latest/stable canonical✓ broken chromium 2271 latest/stable canonical✓ broken core18 2667 latest/stable canonical✓ broken core20 1778 latest/stable canonical✓ broken core22 484 latest/stable canonical✓ broken cups 872 latest/stable openprinting✓ broken dnslookup 156 latest/stable ameshkov✓ broken fast 4 latest/stable ddooo broken

test command: $sudo snap run hello-world

error: cannot find current revision for snap hello-world: readlink /snap/hello-world/current: no such file or directory

$sudo snap install hello-world

2023-01-23T16:52:04+03:00 INFO Waiting for automatic snapd restart…

error: cannot perform the following tasks:

  • Run hook connect-plug-host-hunspell of snap “firefox” (run hook “connect-plug-host-hunspell”: error: cannot find current revision for snap firefox: readlink /snap/firefox/current: no such file or directory)

removing hunspell snap didn’t solved the issue.

$ snap run gedit

cannot locate base snap core22: No such file or directory

$ sudo snap install core22

snap “core22” is already installed, see ‘snap help refresh’

$ snap run flux

cannot locate base snap core22: No such file or directory

$snap run gravit-designer

cannot locate base snap core: No such file or directory

$snap run firefox

error: cannot find current revision for snap firefox: readlink /snap/firefox/current: no such file or directory

snap install firefox

snap “firefox” is already installed, see ‘snap help refresh’

reinstalling snapd didn’t solve the issue either.

reinstalling snaps doesn’t solve the issue too.

I’m stuck, waiting for your help.

Somehow i restored some of the snaps idk what solved the issue partially but i’m glad it did.

but firefox is still in purgatory. sudo snap install firefox

snap “firefox” is already installed, see ‘snap help refresh’

sudo snap run firefox

error: cannot find current revision for snap firefox: readlink /snap/firefox/current: no such file or directory

sudo snap remove firefox

error: cannot perform the following tasks:

  • Remove data for snap “firefox” (2277) (unlinkat /var/snap/firefox/common/host-hunspell/en_AU.dic: read-only file system)

but https://askubuntu.com/a/1434769/561349 solved the problem for anyone who wondering.

urgh … you should never ever manually unmount snaps or remove snap mount units like that askubuntu post suggests, that can trash a lot on your system …

the access to the hosts hunspell dictionaries for firefox is handled by the host-hunspell interface which you should disconnect using:

$ sudo snap disconnect firefox:host-hunspell

after which you can properly do a

$ sudo snap remove --purge firefox

to remove it …

that the interface does not automatically disconnect on snap uninstall operations might be a bug though, you should file it against the snapd debian package in ubuntu.

in general your other errors rather indicate a system level problem (corrupt or full filesystem, incompatible/broken kernel installed, etc etc) which you should research …