如何看待 snap软件包?snap refresh --hold

107 篇文章 0 订阅

Ubuntu 现支持暂时 / 永久禁用 snap 软件包自动更新

期待已久,Ubuntu 终于支持禁用 snap 自动更新

如何看待 snap软件包?

snap 官方手册 (ubuntu) ***

-----------------------------------------------------------

要点:

安装 snap 软件包的一个好处,是 snap app软件包,可以跨不同的 Linux 发行版。

------------

    要禁用所有的 snap 应用程序自动更新,只需在命令中省略软件包名称。因此,通过运行以下命令即可禁用所有应用程序的自动更新。

在 22.04 上

$ snap refresh --hold
运行 snap "core" 的配置钩子      Auto-refresh of all snaps held(使保持) indefinitely(无限期地)

注:运行上句命令后,会弹出密码输入窗口,需要管理员权限 ?

    反之,通过 --unhold 参数重新启用自动更新。

snap refresh --unhold

    要重新启用特定应用程序的自动更新,例如 Firefox,则在命令中添加名称即可:

snap refresh --unhold firefox

(22.04 已经有这个命令了?)该命令目前并没有出现在 Ubuntu 正式版本中,如果你想尝试的话需要通过命令将 snapd 切换到 edge 通道:

snap refresh snapd --edge

测试完成后,如果需要将 snapd 切换回稳定通道,则需要使用命令:

snap refresh snapd --stable

更新所有的snap软件包:  https://blog.csdn.net/gongyuan91/article/details/106324052

sudo snap refresh all

手动更新:

------

摘要:

snap 是 Canonical 为使用 Linux 内核和 systemd init 系统的操作系统开发的软件打包和部署系统。这些被称为 snap 的软件包和使用它们的工具 snapd 可以在一系列的 Linux 发行版中使用,并允许上游软件开发者直接向用户发布他们的应用程序。

借助 snap,用户可以轻松地安装 Linux 应用程序,在默认情况下,snapd 一天内会检查四次更新,并自动将 snap 应用更新到最新的版本。虽然有很多方法可以控制更新的安装时间和频率,但为了安全用户无法完全关闭自动更新。

虽然 snap 的初衷很好,但很多开发者都深受它的困扰,时不时就会发现常用的开发工具自动更新了,导致插件、依赖出现了不兼容的情况,不得不手动回退版本。正因如此,不少开发者在安装 Ubuntu 之后第一件做的事情就是卸载 snap。

结论:

1. 普通桌面应用,最好是关闭 snap 的自动更新。

原因是:app 的作者,不可能有太多的时间来测试这款 app、或者本次 app更新是否存在有 Bug,这很耗费时间和精力,甚至是不可能的。

当 app的作者将 存在 Bug的本次更新上传之后,而 snap 默认的自动更新功能,就会将用户的这款 app从 OK 更新到 NG。

2. 为什么 snap 默认设置成自动更新呢?

从嵌入式产品的角度来说,每个 4个小时?更新一次,这是一种好的做法。

Flatpak、KDE discover:也是可以更新,但默认不会自动更新。

可能的原因是 ?:为 Ubuntu 嵌入式版本提供服务。

嵌入式版本,采用 snap 来解决跨发行版问题。

同时,嵌入式产品的 app snap 的更新,由嵌入式产品产家自己控制,

解决:

1. 对于 snap app 在自动更行之后,会导致插件、依赖出现了不兼容的这种问题,app 的作者无法避免;snap官方(ubuntu)也无法避免。

因此,对于这种问题:关闭 snap 的自动更新,这可能是最佳的解决方案 ?

snap refresh --hold

  • 当用户想要更新某款 app时,直接运行相关命令即可。如果出现了问题,用户也会做到心中有数
  • 如果由于 snap 的自动更新功能,而导致了某款 app出现问题,这时:用户是心中的。

心中有数”与“心中”,这应该不是一个困难的选择吧?

2. 参考 Flatpak :可以更新,但默认不会自动更新。

KDE discover:也是可以更新,但默认不会自动更新。

-----------------------------------------------------------


​什么是Snap应用?  https://cn.ubuntu.com/blog/what-is-snap-application

-----------------------------------------------------------

参考:

Ubuntu Desktop 实践 08、从剖析 snap 到卸载 snap  https://blog.csdn.net/ken2232/article/details/136426365

Linux snap命令使用详解  https://blog.csdn.net/gongyuan91/article/details/106324052

==================================

如何看待 snap软件包?

  https://www.zhihu.com/question/47659130

snap 会自动更新你的软件并导致其损坏,而且无法关闭,你如果软件用着突然出问题,死活找不到问题出在哪。

发布于 2020-12-04 21:54

Ubuntu 现支持暂时 / 永久禁用 snap 软件包自动更新

  https://www.ithome.com/0/654/570.htm
2022/11/17 14:58:02

IT之家 11 月 17 日消息,Canonical 今天宣布,允许用户对 snap 格式软件包执行暂时或者永久禁用自动更新。在默认情况下,snap 软件包会自动更新,以便于确保你的应用始终处于最新的状态。

[Ubuntu 现支持暂时 / 永久禁用 snap 软件包自动更新]

由于 snap 软件包格式的自动更新模式,有时候会导致某款软件出现不兼容、无法使用的情况。好消息是虽然 Canonical 现在允许用户设置临时禁用或者永久禁用,但不支持图形化操作,需要在终端里用命令行方式执行。

IT之家了解到,例如,你想要让 VLC 媒体播放器的 snap 软件包临时禁用自动更新,可以输入:

snap refresh --hold=72h vlc

然后输出结果会是这样的:

General refreshes of "vlc" held until 2022-11-17T12:04:59Z

如果你想要暂时禁用 snap 软件包自动更新,命令为:

snap refresh --hold=48h

如果你想要永久禁用 snap 软件包自动更新,命令为:

snap refresh --hold

snap refresh --hold

期待已久,Ubuntu 终于支持禁用 snap 自动更新

  https://zhuanlan.zhihu.com/p/584209728

snap 是 Canonical 为使用 Linux 内核和 systemd init 系统的操作系统开发的软件打包和部署系统。这些被称为 snap 的软件包和使用它们的工具 snapd 可以在一系列的 Linux 发行版中使用,并允许上游软件开发者直接向用户发布他们的应用程序。

借助 snap,用户可以轻松地安装 Linux 应用程序,在默认情况下,snapd 一天内会检查四次更新,并自动将 snap 应用更新到最新的版本。虽然有很多方法可以控制更新的安装时间和频率,但为了安全用户无法完全关闭自动更新。

虽然 snap 的初衷很好,但很多开发者都深受它的困扰,时不时就会发现常用的开发工具自动更新了,导致插件、依赖出现了不兼容的情况,不得不手动回退版本。正因如此,不少开发者在安装 Ubuntu 之后第一件做的事情就是卸载 snap。

近日,Ubuntu 通过官方博客宣布,一项开发者期待已久的功能悄悄地进入了预览阶段,从现在起你可以完全关闭 snap 的自动更新了:

snap refresh --hold 命令保持或推迟单个 snap 应用或系统上所有 snap 应用的更新,可以是无限期的,也可以是指定时间段的。(目前只在 edge 通道的 snapd 中可用)

保持或完全禁用 snap 更新

该功能是通过使用 snap refresh 命令的一个新的 --hold 参数完成的。

  • 例如,通过命令完全禁用 Firefox 的自动更新:

snap refresh --hold firefox
  • 或者,通过命令为 Firefox 保留 24 小时的自动更新:

snap refresh --hold=24h firefox
  • 要禁用所有的 snap 应用程序自动更新,只需在命令中省略软件包名称。因此,通过运行以下命令即可禁用所有应用程序的自动更新。

snap refresh --hold
  • 反之,通过 --unhold 参数重新启用自动更新。

snap refresh --unhold
  • 要重新启用特定应用程序的自动更新,例如 Firefox,则在命令中添加名称即可:

snap refresh --unhold firefox

该命令目前并没有出现在 Ubuntu 正式版本中,如果你想尝试的话需要通过命令将 snapd 切换到 edge 通道:

snap refresh snapd --edge

测试完成后,如果需要将 snapd 切换回稳定通道,则需要使用命令:

snap refresh snapd --stable

天下苦 snap 久矣,但随着 snap 更新机制的不断完善,Ubuntu 终于增加了对禁用 snap 应用程序自动更新的支持,大家还会给 snap 一个机会吗?

发布于 2022-11-17 11:18・IP 属地广东

snap 官方手册 (ubuntu) ***

$ snap --help
The snap command lets you install, configure, refresh and remove snaps.
Snaps are packages that work across many different Linux distributions,
enabling secure delivery and operation of the latest apps and utilities.

Usage: snap <command> [<options>...]

Commonly used commands can be classified as follows:

.                                                                                                  

           Basics: find, info, install, remove, list
          ...more: refresh, revert, switch, disable, enable, create-cohort
          History: changes, tasks, abort, watch
          Daemons: services, start, stop, restart, logs
      Permissions: connections, interface, connect, disconnect
    Configuration: get, set, unset, wait
      App Aliases: alias, aliases, unalias, prefer
          Account: login, logout, whoami
        Snapshots: saved, save, check-snapshot, restore, forget
           Device: model, remodel, reboot, recovery
     Quota Groups: set-quota, remove-quota, quotas, quota
  Validation Sets: validate
        ... Other: warnings, okay, known, ack, version
      Development: validate

.

For more information about a command, run 'snap help <command>'.
For a short summary of all commands, run 'snap help --all'.

$ snap help --all
The snap command lets you install, configure, refresh and remove snaps.
Snaps are packages that work across many different Linux distributions,
enabling secure delivery and operation of the latest apps and utilities.

Usage: snap <command> [<options>...]

Commands can be classified as follows:

.

  Basics (basic snap management):
    find             Find packages to install
    info             Show detailed information about snaps
    install          Install snaps on the system
    remove           Remove snaps from the system
    list             List installed snaps

.

  ...more (slightly more advanced snap management):
    refresh          Refresh snaps in the system
    revert           Reverts the given snap to the previous state
    switch           Switches snap to a different channel
    disable          Disable a snap in the system
    enable           Enable a snap in the system
    create-cohort    Create cohort keys for a set of snaps

.

  History (manage system change transactions):
    changes          List system changes
    tasks            List a change's tasks
    abort            Abort a pending change
    watch            Watch a change in progress

.

  Daemons (manage services):
    services         Query the status of services
    start            Start services
    stop             Stop services
    restart          Restart services
    logs             Retrieve logs for services

.

  Permissions (manage permissions):
    connections      List interface connections
    interface        Show details of snap interfaces
    connect          Connect a plug to a slot
    disconnect       Disconnect a plug from a slot

.

  Configuration (system administration and configuration):
    get              Print configuration options
    set              Change configuration options
    unset            Remove configuration options
    wait             Wait for configuration

.

  App Aliases (manage aliases):
    alias            Set up a manual alias
    aliases          List aliases in the system
    unalias          Remove a manual alias, or the aliases for an entire snap
    prefer           Enable aliases from a snap, disabling any conflicting aliases

.

  Account (authentication to snapd and the snap store):
    login            Authenticate to snapd and the store
    logout           Log out of snapd and the store
    whoami           Show the email the user is logged in with

.

  Snapshots (archives of snap data):
    saved            List currently stored snapshots
    save             Save a snapshot of the current data
    check-snapshot   Check a snapshot
    restore          Restore a snapshot
    forget           Delete a snapshot
    export-snapshot  Export a snapshot
    import-snapshot  Import a snapshot

.

  Device (manage device):
    model            Get the active model for this device
    remodel          Remodel this device
    reboot           Reboot into selected system and mode
    recovery         List available recovery systems

.

  Warnings (manage warnings):
    warnings         List warnings
    okay             Acknowledge warnings

.

  Assertions (manage assertions):
    known            Show known assertions of the provided type
    ack              Add an assertion to the system

.

  Introspection (introspection and debugging of snapd):
    version          Show version details
    debug            Run debug commands

.

  Development (developer-oriented features):
    download         Download the given snap
    pack             Pack the given directory as a snap
    run              Run the given snap command
    try              Test an unpacked snap in the system
    prepare-image    Prepare a device image

.

  Quota Groups (Manage quota groups for snaps):
    set-quota        Create or update a quota group.
    remove-quota     Remove quota group
    quotas           Show quota groups
    quota            Show quota group for a set of snaps

.

  Validation Sets (Manage validation sets):
    validate         List or apply validation sets

For more information about a command, run 'snap help <command>'.

~$ snap help refresh
Usage:
  snap refresh [refresh-OPTIONS] [<snap>...]

.

The refresh command updates the specified snaps, or all snaps in the system if
none are specified.

With no further options, the snaps are refreshed to the current revision of the
channel they're tracking, preserving their confinement options. All available
channels of a snap are listed in its 'snap info' output.

When --revision is used, a later refresh will typically undo the revision
override.

.

Hold (--hold) is used to postpone snap refresh updates for all snaps when no
snaps are specified, or for the specified snaps.

.

When no snaps are specified --hold is only effective on auto-refreshes and will
not block either general refresh requests from 'snap refresh' or specific snap
requests from 'snap refresh target-snap'.

.

When snaps are specified --hold is effective on both their auto-refreshes
and general refresh requests from 'snap refresh'. However, specific snap
requests from 'snap refresh target-snap' remain unblocked and will proceed.

      当 snap 指定了参数为 --hold 时,在这两种情况下是有效(指:保持现状,不会被更新)的:auto-refreshes 自动刷新,以及来自 'snap refresh' 的常规刷新请求。

但是,指定了软件名称(目标)刷新 'snap refresh target-snap'  的请求保持未阻止状态,并将继续更新。

.

[refresh command options]
      --color=[auto|never|always]          Use a little bit of color to
                                           highlight some things. (default:
                                           auto)
      --unicode=[auto|never|always]        Use a little bit of Unicode to
                                           improve legibility. (default: auto)
      --abs-time                           Display absolute times (in RFC 3339
                                           format). Otherwise, display relative
                                           times up to 60 days, then YYYY-MM-DD.
      --no-wait                            Do not wait for the operation to
                                           finish but just print the change id.
      --channel=                           Use this channel instead of stable
      --edge                               Install from the edge channel
      --beta                               Install from the beta channel
      --candidate                          Install from the candidate channel
      --stable                             Install from the stable channel
      --devmode                            Put snap in development mode and
                                           disable security confinement
      --jailmode                           Put snap in enforced confinement mode
      --classic                            Put snap in classic mode and disable
                                           security confinement
      --amend                              Allow refresh attempt on snap
                                           unknown to the store
      --revision=                          Refresh to the given revision
      --cohort=                            Refresh the snap into the given
                                           cohort
      --leave-cohort                       Refresh the snap out of its cohort
      --list                               Show the new versions of snaps that
                                           would be updated with the next
                                           refresh
      --time                               Show auto refresh information but do
                                           not perform a refresh
      --ignore-validation                  Ignore validation by other snaps
                                           blocking the refresh
      --transaction=[all-snaps|per-snap]   Have one transaction per-snap or one
                                           for all the specified snaps
                                           (default: per-snap)
      --hold=                              Hold refreshes for a specified
                                           duration (or forever, if no value is
                                           specified
)
      --unhold                             Remove refresh hold

  • 11
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值