无法修复 Ubuntu 22.04 上损坏的 snap core22

Art*_*nin 1 snap 22.04

在最近的一次系统更新后,snap 已损坏。例如,电报桌面停止工作。我设法删除了 telegram,但无法重新安装。原因是 core22 模块损坏:

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

我尝试删除 core22 来修复该问题,但没有成功:

\n
error: cannot perform the following tasks:\n- Remove data for snap "core22" (522) (failed to remove snap "core22" base directory: remove /var/snap/core22: directory not empty)\n
Run Code Online (Sandbox Code Playgroud)\n

我也无法修复它。我尝试过sudo snap refresh core22 --edge,但它不起作用:

\n
error: cannot refresh "core22": refreshing disabled snap "core22" not supported\n
Run Code Online (Sandbox Code Playgroud)\n

尝试启用 core22 但sudo snap enable core22失败:

\n
error: cannot perform the following tasks:\n- Setup snap "core22" (522) security profiles (cannot find installed snap "core22" at revision 522: missing file /snap/core22/522/meta/snap.yaml)\n
Run Code Online (Sandbox Code Playgroud)\n

系统信息:

\n
5.19.0-32-generic #33~22.04.1-Ubuntu\n
Run Code Online (Sandbox Code Playgroud)\n

snap list --all

\n
Name                       Version                     Rev    Tracking         Publisher      Notes\nbare                       1.0                         5      latest/stable    canonical\xe2\x9c\x93     base\nchromium                   110.0.5481.100              2333   latest/stable    canonical\xe2\x9c\x93     -\nchromium                   110.0.5481.77               2319   latest/stable    canonical\xe2\x9c\x93     disabled\ncore                       16-2.58                     14447  latest/stable    canonical\xe2\x9c\x93     core,disabled\ncore                       16-2.58.2                   14784  latest/stable    canonical\xe2\x9c\x93     core\ncore18                     20230118                    2679   latest/stable    canonical\xe2\x9c\x93     base,disabled\ncore18                     20230207                    2697   latest/stable    canonical\xe2\x9c\x93     base\ncore20                     20230126                    1822   latest/stable    canonical\xe2\x9c\x93     base\ncore20                     20221212                    1778   latest/stable    canonical\xe2\x9c\x93     base,disabled\ncore22                     -                           522    latest/stable    canonical\xe2\x9c\x93     disabled,broken\ncups                       2.4.2-5                     872    latest/stable    openprinting\xe2\x9c\x93  -\ncups                       2.4.2-4                     836    latest/stable    openprinting\xe2\x9c\x93  disabled\ncura-slicer                4.13.2                      100    latest/stable    glasen         disabled\ncura-slicer                4.13.2                      102    latest/stable    glasen         -\nfirecamp                   2.7.1                       202    latest/stable    nishchit14     -\nfirefox                    109.0.1-1                   2311   latest/stable/\xe2\x80\xa6  mozilla\xe2\x9c\x93       disabled\nfirefox                    110.0-3                     2356   latest/stable/\xe2\x80\xa6  mozilla\xe2\x9c\x93       -\ngnome-3-28-1804            3.28.0-19-g98f9e67.98f9e67  161    latest/stable    canonical\xe2\x9c\x93     -\ngnome-3-34-1804            0+git.3556cb3               77     latest/stable    canonical\xe2\x9c\x93     -\ngnome-3-38-2004            0+git.891e5bc               115    latest/stable/\xe2\x80\xa6  canonical\xe2\x9c\x93     disabled\ngnome-3-38-2004            0+git.6f39565               119    latest/stable/\xe2\x80\xa6  canonical\xe2\x9c\x93     -\ngnome-42-2204              0+git.0c1a50b               56     latest/stable    canonical\xe2\x9c\x93     -\ngtk-common-themes          0.1-81-g442e511             1535   latest/stable/\xe2\x80\xa6  canonical\xe2\x9c\x93     -\ngtk-common-themes          0.1-79-ga83e90c             1534   latest/stable/\xe2\x80\xa6  canonical\xe2\x9c\x93     disabled\npdftk                      2.02-4                      9      latest/stable    smoser         -\nslack                      4.28.184                    67     latest/stable    slack\xe2\x9c\x93         disabled\nslack                      4.29.149                    68     latest/stable    slack\xe2\x9c\x93         -\nsnap-store                 41.3-68-gf43d07e            681    latest/edge      canonical\xe2\x9c\x93     -\nsnap-store                 41.3-66-gfe1e325            638    latest/edge      canonical\xe2\x9c\x93     disabled\nsnapd                      2.58.3+git520.gb0848d7      18621  latest/edge      canonical\xe2\x9c\x93     snapd\nsnapd                      2.58.2                      18357  latest/edge      canonical\xe2\x9c\x93     snapd,disabled\nsnapd-desktop-integration  0.1                         49     latest/stable/\xe2\x80\xa6  canonical\xe2\x9c\x93     -\n
Run Code Online (Sandbox Code Playgroud)\n

响应ls -la /var/snap/core22

\n
total 12\ndrwxr-xr-x  3 root root 4096 helmi  24 11:50 .\ndrwxr-xr-x 22 root root 4096 helmi  26 11:53 ..\ndrwxr-xr-x  2 root root 4096 hein\xc3\xa4  24  2022 504\n
Run Code Online (Sandbox Code Playgroud)\n

有没有什么方法可以修复core22而不需要在系统上完全重新安装 snap?谢谢

\n

更新:添加了有关删除尝试的信息。\n更新2:添加了ls -la /var/snap/core22

\n

kra*_*rah 5

编辑:很抱歉我显然没有读到您已经尝试过


我可以通过刷新到测试版频道并随后刷新回稳定频道来解决这个问题

所以,首先我跑了

$ sudo snap refresh --beta core22
Run Code Online (Sandbox Code Playgroud)

进而

$ sudo snap refresh --stable core22
Run Code Online (Sandbox Code Playgroud)

安装过程然后返回预期的行为