CUPS 最近已转移到 snap 吗?

CUPS 最近已转移到 snap 吗?

我正在运行 Ubuntu 20.04。我刚刚在发出snap list命令后注意到,我已安装的 snap 包列表包括cups版本 2.4.2-4。目录/snap/cups几天前更新过:

drwxr-xr-x 11 root root 159 Oct 22 07:21 836
lrwxrwxrwx  1 root root   3 Nov  1 19:38 current -> 836

上次我检查时,这个 snap 包还没有出现。我不记得手动安装过它。Synaptic Package Manager 仍然显示cups-*我的系统上安装的 DEB 包版本为 2.3.1-9ubuntu1.2(cups-daemon、等)。cups-commoncups-core-drivers

ps如果我正确读取输出,则 DEB 和 snap 包似乎都在我的系统上运行:

root         919       1  0 20:34 ?        00:00:00 /usr/sbin/cupsd -l
root         928       1  0 20:34 ?        00:00:00 /usr/sbin/cups-browsed
root         936       1  0 20:34 ?        00:00:00 /bin/sh /snap/cups/836/scripts/run-cups-browsed
root         938       1  0 20:34 ?        00:00:00 /bin/sh /snap/cups/836/scripts/run-cupsd
root        1223     938  0 20:34 ?        00:00:00 cupsd -f -s /var/snap/cups/common/etc/cups/cups-files.conf -c /var/snap/cups/common/etc/cups/cupsd.conf
root        1311     936  0 20:34 ?        00:00:00 /bin/sh /snap/cups/836/scripts/run-cups-browsed

Canonical 最近是否在未告知任何人的情况下在 Ubuntu 20.04 中用 snap 版本替换了 CUPS DEB 版本?如果是,为什么两者都在运行?如果没有,可能安装了 snap 版本,它有什么用途?

如果这有帮助的话,这是我的完整输出snap list

Name               Version                     Rev    Tracking         Publisher      Notes
bare               1.0                         5      latest/stable    canonical✓     base
caprine            2.56.1                      52     latest/stable    sindresorhus   -
chromium           107.0.5304.87               2168   latest/stable    canonical✓     -
core               16-2.57.2                   13886  latest/stable    canonical✓     core
core18             20221027                    2620   latest/stable    canonical✓     base
core20             20220919                    1634   latest/stable    canonical✓     base
cups               2.4.2-4                     836    latest/stable    openprinting✓  -
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.6f39565               119    latest/stable    canonical✓     -
gtk-common-themes  0.1-81-g442e511             1535   latest/stable/…  canonical✓     -
overlay            0.2                         10     latest/stable    kyrofa         -
snap-store         41.3-64-g512c0ff            599    latest/stable    canonical✓     -
snapd              2.57.4                      17336  latest/stable    canonical✓     snapd
syzygy             v1.0.1                      2      latest/stable    popey          -

更新:这个问题有一个答案(现在不存在了)告诉我删除 CUPS snap - 如果其他 snap 依赖于它,这显然是不可能的。但是,我能够毫无问题地删除它。我检查了一下,它snap list不在那里。今天我收到一条通知说它想要更新(见下面的截图),所以我snap list又做了一次,它在那里。

journalctl -ru snapd按照(现在不存在的)答案中的指示进行了检查,结果发现在我于 11 月 9 日移除 snap 包后,它不知何故于 11 月 12 日再次被安装。日志显示:

Nov 12 22:01:20 jarek-02 snapd[786]: snap has no updates available: "bare", "caprine", "chromium", "core", "core18", "core20", "cups", "gnome-3-28-1804", "gnome-3-34-1804", "gnome-3-38-2004", "gtk-common-themes", "overlay", "snap-store", "snapd"
Nov 12 22:01:20 jarek-02 snapd[786]: storehelpers.go:748: cannot refresh:
Nov 12 16:49:20 jarek-02 snapd[786]: storehelpers.go:748: cannot refresh snap "chromium": snap has no updates available
Nov 12 16:48:58 jarek-02 snapd[786]: autorefresh.go:540: auto-refresh: all snaps are up-to-date
Nov 12 16:48:58 jarek-02 snapd[786]: snapstate.go:1591: cannot refresh snap "chromium": snap "chromium" has "refresh-snap" change in progress
Nov 12 16:48:58 jarek-02 snapd[786]: snap not found: "syzygy"
Nov 12 16:48:58 jarek-02 snapd[786]: snap has no updates available: "bare", "caprine", "core", "core18", "core20", "gnome-3-28-1804", "gnome-3-34-1804", "gnome-3-38-2004", "gtk-common-themes", "overlay", "snap-store", "snapd"

因此,如果我没有看错的话,11 月 12 日 16:48,CUPS 快照不存在(它未在“快照没有可用更新”消息中列出,并且同一组快照在该消息的先前出现中列出),而在下一次检查时,即 11 月 12 日 22:01,它已经存在。在这两次检查之间,Chromium 快照已更新。那么 CUPS 快照是否可能与 Chromium 一起自动安装?

在此处输入图片描述

答案1

看起来实际上是 Chromium 引入了 CUPS snap。我按照答案链接在评论中并得到以下输出:

raj@jarek-02:~$ grep "cups:" /snap/*/*/meta/snap.yaml
/snap/chromium/2238/meta/snap.yaml:  foo-install-cups:
/snap/chromium/2254/meta/snap.yaml:  foo-install-cups:
/snap/chromium/current/meta/snap.yaml:  foo-install-cups:
/snap/cups/836/meta/snap.yaml:  etc-cups:
/snap/cups/836/meta/snap.yaml:  cups:
/snap/cups/872/meta/snap.yaml:  etc-cups:
/snap/cups/872/meta/snap.yaml:  cups:
/snap/cups/current/meta/snap.yaml:  etc-cups:
/snap/cups/current/meta/snap.yaml:  cups:

*.yamlChromium snap 的文件包含,foo-install-cups因此看起来它实际上是安装/更新了 Chromium snap 并引入了 CUPS。

相关内容