8

To upgrade existing packages using apt-get in Ubuntu, the commands below are used

$ apt-get update
$ apt-get upgrade

What are the equivalent commands in snap to do the same thing to upgrade packages installed from snap store?

I am using Ubuntu 20.

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • apt-get-upgrade is not a command, apt-get is the command and upgrade the function/operation apt-get will perform – guiverc Jul 26 '20 at 02:26
  • Thread is locked so I can't answer, so putting it in a comment. Run sudo snap refresh – Davide Aug 24 '22 at 22:38

1 Answers1

8

You don't need to: Snaps are (mostly) updated automatically by default.

That's one of their key features.

Here's how to determine how often snapd will check for updates: (source)

$ snap refresh --time
timer: 00:00~24:00/4        <------ "/4" means refresh every 4 hours.
last: today at 17:15 CDT
next: today at 21:45 CDT

However, snap-provided applications are not updated while the application is running.

  • Example: Firefox and Discord and Ubuntu Software will emit a "close the application" reminder while running during one of those periodic updates.

    If the reminders are ignored for 14 days, the application will terminate without warning in order to update. (The notifications are an improvement: There used to be no notification at all, and folks just thought that their long-running application had crashed every few weeks)

Ubuntu 22.04 and older: Users of these applications must currently close the application, then run sudo snap refresh, and wait for the refresh to complete before re-opening their application. There are open bugs to improve snapd's handling of long-running applications, which will improve the user experience: LP:#1945165 and LP:#1980271. Snapd is Open Source, and code contributions to the development team are welcome.

Ubuntu 23.04 and newer: Users of these applications must currently Quit the application sometime during the 14-day window. Snapd will automatically run the refresh when it detects that the application has stopped. Snapd will notify you when the refreshed application is ready to be restarted. You can also use the manual refresh method (sudo snap refresh) of Ubuntu 22.04 and older.

user535733
  • 62,253