Score:2

Cannot repair the broken snap core22 on Ubuntu 22.04

in flag

snap has broken after one of recent system updates. For example, telegram desktop stopped working. I managed to remove telegram, but cannot reinstall that. The reason is in broken core22 module:

error: cannot perform the following tasks:
- Run configure hook of "telegram-desktop" snap if present (run hook "configure": cannot locate base snap core22: No such file or directory)

I tried to remove core22 to repair that, but it didn't work:

error: cannot perform the following tasks:
- Remove data for snap "core22" (522) (failed to remove snap "core22" base directory: remove /var/snap/core22: directory not empty)

I couldn't repair that neither. I tried sudo snap refresh core22 --edge, though it doesn't work:

error: cannot refresh "core22": refreshing disabled snap "core22" not supported

Attempt to enable core22 with sudo snap enable core22 fails:

error: cannot perform the following tasks:
- Setup snap "core22" (522) security profiles (cannot find installed snap "core22" at revision 522: missing file /snap/core22/522/meta/snap.yaml)

System info:

5.19.0-32-generic #33~22.04.1-Ubuntu

snap list --all

Name                       Version                     Rev    Tracking         Publisher      Notes
bare                       1.0                         5      latest/stable    canonical✓     base
chromium                   110.0.5481.100              2333   latest/stable    canonical✓     -
chromium                   110.0.5481.77               2319   latest/stable    canonical✓     disabled
core                       16-2.58                     14447  latest/stable    canonical✓     core,disabled
core                       16-2.58.2                   14784  latest/stable    canonical✓     core
core18                     20230118                    2679   latest/stable    canonical✓     base,disabled
core18                     20230207                    2697   latest/stable    canonical✓     base
core20                     20230126                    1822   latest/stable    canonical✓     base
core20                     20221212                    1778   latest/stable    canonical✓     base,disabled
core22                     -                           522    latest/stable    canonical✓     disabled,broken
cups                       2.4.2-5                     872    latest/stable    openprinting✓  -
cups                       2.4.2-4                     836    latest/stable    openprinting✓  disabled
cura-slicer                4.13.2                      100    latest/stable    glasen         disabled
cura-slicer                4.13.2                      102    latest/stable    glasen         -
firecamp                   2.7.1                       202    latest/stable    nishchit14     -
firefox                    109.0.1-1                   2311   latest/stable/…  mozilla✓       disabled
firefox                    110.0-3                     2356   latest/stable/…  mozilla✓       -
gnome-3-28-1804            3.28.0-19-g98f9e67.98f9e67  161    latest/stable    canonical✓     -
gnome-3-34-1804            0+git.3556cb3               77     latest/stable    canonical✓     -
gnome-3-38-2004            0+git.891e5bc               115    latest/stable/…  canonical✓     disabled
gnome-3-38-2004            0+git.6f39565               119    latest/stable/…  canonical✓     -
gnome-42-2204              0+git.0c1a50b               56     latest/stable    canonical✓     -
gtk-common-themes          0.1-81-g442e511             1535   latest/stable/…  canonical✓     -
gtk-common-themes          0.1-79-ga83e90c             1534   latest/stable/…  canonical✓     disabled
pdftk                      2.02-4                      9      latest/stable    smoser         -
slack                      4.28.184                    67     latest/stable    slack✓         disabled
slack                      4.29.149                    68     latest/stable    slack✓         -
snap-store                 41.3-68-gf43d07e            681    latest/edge      canonical✓     -
snap-store                 41.3-66-gfe1e325            638    latest/edge      canonical✓     disabled
snapd                      2.58.3+git520.gb0848d7      18621  latest/edge      canonical✓     snapd
snapd                      2.58.2                      18357  latest/edge      canonical✓     snapd,disabled
snapd-desktop-integration  0.1                         49     latest/stable/…  canonical✓     -

Response to ls -la /var/snap/core22

total 12
drwxr-xr-x  3 root root 4096 helmi  24 11:50 .
drwxr-xr-x 22 root root 4096 helmi  26 11:53 ..
drwxr-xr-x  2 root root 4096 heinä  24  2022 504

Is there any way to fix core22 without complete re-installation of snap on the system? Thanks

Upd: added info about removal attempt. Upd2: added ls -la /var/snap/core22

pl flag
Are you able to `snap remove core22` (you may need to remove some other things that depend on it, including telegram-desktop)? Then can it be reinstalled after a reboot?
Artem  Plyusnin avatar
in flag
@popey thanks. I forgot to mention that, I tried of course to remove core22 completely, but it failed (I updated the original post with the reply from the system). Also, it didn't show any dependencies, unlike for example core20. The latter showed `error: cannot remove "core20": snap "core20" is not removable: snap is being used by snaps chromium, cups, cura-slicer, firefox, gnome-3-38-2004 and 2 more.`
noisefloor avatar
ec flag
There is a mismatch - you have a problem with cor22, but try to remove core20? That's wrong and won't solve you problem. Please add the output of `snap list --all` to the original question.
Artem  Plyusnin avatar
in flag
@noisefloor sorry for being not very clear. I added response to attempt to remove core20 (when it warns about dependencies) to show the contrast with the attempt to remove core22 (when there's no info about dependencies, only error message). I'll add `snap list --all` to my original post
noisefloor avatar
ec flag
What it is strange is that only one snap named core22 is in the list - there should be two. What is the output in the terminal of `ls -la /var/snap/core22`?
Artem  Plyusnin avatar
in flag
@noisefloor Sorry for delay, I haven't seen your reply. I added the output which you asked for.
noisefloor avatar
ec flag
There is indeed something broken here, however this was achieved. Manually deleting things ma not be the way to go. Can you reinstall core22 by `sudo snap install core22`? If it works, please post the output of `snap list --all` after successful installation.
Artem  Plyusnin avatar
in flag
@noisefloor Attempt to reinstall it gives: `snap "core22" is already installed, see 'snap help refresh'`
noisefloor avatar
ec flag
What happens if you run `sudo snap revert core22`?
Artem  Plyusnin avatar
in flag
@noisefloor It throws: `error: cannot revert "core22": no revision to revert to`
noisefloor avatar
ec flag
Actually that's what I'm expected. Seems like something is messed up like an unfinished removal process. Don't know how to resolve the manually, sorry.
Score:2
ad flag

Edit: I'm sorry i obviously didn't read that you already tried that


I was able to work around this by refreshing to the beta channel and subsequently refreshing back to the stable channel

So, first i ran

$ sudo snap refresh --beta core22

and then

$ sudo snap refresh --stable core22

The installing procedures then returned the expected behaviour

Score:0
in flag

Finally I found a solution. In fact, this was on the surface, if we look back to the error messages which I posted in the original message:

  1. sudo rm -rf /var/snap/core22
  2. sudo snap remove core22
  3. sudo snap install core22
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.