`snap list --all` 不会显示 /var/lib/snapd/snaps 中的所有内容

`snap list --all` 不会显示 /var/lib/snapd/snaps 中的所有内容

我有很多旧照片/var/libd/snaps

#> ls /var/lib/snapd/snaps | sort
bare_5.snap
chromium_2556.snap
chromium_2642.snap
core_16091.snap
core18_2790.snap
core20_2015.snap
core22_864.snap
cups_980.snap
firefox_2579.snap
firefox_2645.snap
firefox_2667.snap
firefox_2710.snap
firefox_2760.snap
firefox_2800.snap
firefox_3026.snap
firefox_3131.snap
firefox_3166.snap
firefox_3206.snap
geth_477.snap
gnome-3-28-1804_198.snap
gnome-3-34-1804_93.snap
gnome-3-38-2004_143.snap
gnome-42-2204_141.snap
gtk-common-themes_1535.snap
hunspell-dictionaries-1-7-2004_2.snap
musescore_228.snap
partial
pycharm-community_347.snap
snapd_20092.snap
snap-store_959.snap
spotify_68.snap

#> snap list --all
Name                            Version                     Rev    Tracking         Publisher      Notes
bare                            1.0                         5      latest/stable    canonical✓     base
chromium                        117.0.5938.92               2642   latest/stable    canonical✓     -
core                            16-2.60.3                   16091  latest/stable    canonical✓     core
core18                          20230703                    2790   latest/stable    canonical✓     base
core20                          20230801                    2015   latest/stable    canonical✓     base
core22                          20230801                    864    latest/stable    canonical✓     base
cups                            2.4.6-4                     980    latest/stable    openprinting✓  -
firefox                         118.0.1-1                   3206   latest/stable    mozilla✓       -
geth                            v1.9.5                      477    latest/stable    elopio         -
gnome-3-28-1804                 3.28.0-19-g98f9e67.98f9e67  198    latest/stable    canonical✓     -
gnome-3-34-1804                 0+git.3556cb3               93     latest/stable/…  canonical✓     -
gnome-3-38-2004                 0+git.efb213a               143    latest/stable    canonical✓     -
gnome-42-2204                   0+git.ff35a85               141    latest/stable    canonical✓     -
gtk-common-themes               0.1-81-g442e511             1535   latest/stable/…  canonical✓     -
hunspell-dictionaries-1-7-2004  1.7-20.04+pkg-6fd6          2      latest/stable    brlin          -
musescore                       3.6.2                       228    latest/stable    musescore✓     -
pycharm-community               2023.2.2                    347    latest/stable    jetbrains✓     classic
snap-store                      41.3-71-g709398e            959    latest/stable/…  canonical✓     -
snapd                           2.60.3                      20092  latest/stable    canonical✓     snapd
spotify                         1.2.13.661.ga588f749        68     latest/stable    spotify✓       -

没有显示所有这些。

我在其他地方看到过一个清理旧快照的脚本

LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
        sudo snap remove "$snapname" --revision="$revision"
    done

这对一些旧的快照有效,但会保留一些。

中的条目是否/var/libd/snaps因某种原因损坏,导致无法查看snap --list?我应该怎么做?删除它们吗?

相关内容