376

What's with 'Pending Update of Snap Store?'

enter image description here

  • 2
    Related for Firefox: https://askubuntu.com/questions/1412140/pending-update-of-firefox-snap-close-the-app-to-avoid-disruptions – Ciro Santilli OurBigBook.com Aug 22 '22 at 07:36
  • 1
    This question has been locked, so I cannot add a new answer. Here is a better answer. I wrote a script that detects when the app is closed, and automatically performs the snap refresh for you. https://gitlab.com/rahvee/snap-update – Edward Ned Harvey Nov 01 '22 at 13:42
  • 2
    I submitted a bug report: https://bugs.launchpad.net/snap-store-desktop/+bug/1998233 As usual, the best way for something to get done about this is to go to the bug report, and near the top click Does this bug affect you > Yes, it affects me – bmaupin Nov 29 '22 at 16:41
  • I quit Slack for few seconds, snap updated it immediately and voila notification is gone! – Smile May 12 '23 at 04:21

11 Answers11

547

There are a couple things happening.

First, let's talk about the EASIEST way to make the notification go away:

  1. Quit the application -- in this case, snap-store (a.k.a. Ubuntu Software). Since snap-store auto-starts upon login, you might not recall that you have it open...but you do.

    • Closing the window is not enough to terminate the application.

    • One way: On the command line, run snap-store --quit

    • Another way: Open Ubuntu Software, look at the top bar, find "Ubuntu Software" on the left side of the top bar. Click it, and select "Quit". enter image description here

  2. Run sudo snap refresh. Let the command complete.

    • If, instead of a refresh, you still get a pop-up that the application needs to be refreshed, then run sudo snap refresh <application-name>.
      The output of that command will return the PID causing the block.
      Use kill <pid> to remove the block.
      Run sudo snap refresh again. This time it should work.
  3. It's now safe to re-launch your application.

    • If you were not using the application before, or you don't know how to launch the application, then you can safely ignore this step.

Second, let's talk about WHY it's happening:

Snapd detects when a new version is available. If the application is currently running, snapd will inhibit updating that application for up to 14 days.

With most applications, this works fine. You Quit out of an application, a few hours later snapd updates the application (it checks several times each day). and the next time you open the application you don't even notice that it's been updated. Great!

But some applications are open for a long time that runs up against that 14-day window. Like web browsers on laptops that get closed/suspended instead of quit/restarted. Unfortunately, when the 14-day window expires, snapd will kill the application in order to implement the upgrade. To the user, this looks like Firefox crashed unexpectedly, losing whatever they were doing.

  • Snapd MUST refresh snaps. That's a legacy of the original design; snaps were originally designed for phones and IOT devices that MUST work reliably and MUST update reliably without user input. You can disable it if you know how...but it's a bad idea for most users -- disabling updates means no security patches and insecure applications.

Third, let's talk about why you are suddenly getting these notifications NOW.

The Snap developers were dissatisfied with those two choices (kill the application to force the upgrade -or- disable upgrades entirely), so they created a better path: Remind the user to Quit the application when convenient. That is the notification you are seeing. It's new (turned on by default) in Ubuntu 22.04.

  • If you ignore it, then when the countdown reaches zero snapd will terminate the application and refresh that snap automatically.

Finally, there's one obvious question remaining: Why isn't this automatic? or perhaps Why doesn't snapd download the update before nagging you?

Well, it IS automatic in Ubuntu 23.04 and newer. But that feature is too new for 22.04 users.

  • Most folks who encounter this issue simply have not used long-lived Snap-packaged desktop applications before. It's a known problem, and various developers are working on it. You are welcome to help them.
user535733
  • 62,253
  • Comments are not for extended discussion; this conversation has been moved to chat. – andrew.46 Aug 09 '22 at 09:45
  • 2
    The key point here is very simple.

    snap will restart automatically if you quit it and it starts when you boot. It can't update a piece of sw when said sw is running. All these answers reflect that what needs to happen is that snap needs stopping and then you can use it from the cli to update itself. Alternatively, you could just leave it to its own devices and (I strongly suspect) after a week or two it will force update itself.

    – nerak99 Aug 30 '22 at 18:42
  • 37
    The application snap-store can be closed from the command line. Do $ snap-store --quit then $ sudo snap refresh will work. – Daniel Sep 11 '22 at 15:46
  • 1
    Thanks for the answer. Pay attention when checking the pids, as some processes may be critical (e.g., the desktop environment). I just killed it – Thecave3 Sep 14 '22 at 08:09
  • 2
    @Daniel added your suggestion to the answer. Thank you! – user535733 Sep 19 '22 at 14:34
  • "You might not recall that you have it open, but you do." - definitely not open, this even occurs right after a login with nothing open or clicked. – Mendhak Dec 06 '22 at 07:24
  • @Mendhak thanks. Edited to specify that snap-store autostarts upon login. – user535733 Dec 06 '22 at 13:50
  • @raj I would not go so far as to say snap is not mature enough to be used in production. Certbot, for example, is now snapped by default for most lInux distros now and works fine in production. Additionally, rdap - a tool for getting IP WHOIS info - also works fine in prod out of the box. There's a ton of snaps that are completely suitable for production, despite some odd update quirks here or there. That does not mean that you can (here at least) simply decree that "snaps are not mature enough for production. (1/2) – Thomas Ward Dec 06 '22 at 16:05
  • @raj (case in point for example: the LXD snap has been stable enough for prod use for years) (2/2) – Thomas Ward Dec 06 '22 at 16:05
  • i suppose a way we could work around this would be to disable the notification for the snap-store......or not start snap-store on login Where would be the appropriate place to start a discussion around this? – Fuseteam Dec 06 '22 at 18:39
  • @ThomasWard I didn't mean snap as the individual applications packaged as snaps. I did mean snap as a software distribution system is not mature enough. – raj Dec 07 '22 at 13:25
  • I quit, opened up terminal and got the popup... sudo snap refresh showed all up tp date. Opened up Ubuntu Software again and it showed me the PID, which I killed and successfully used 'sudo snap refresh'. thx – xchiltonx Dec 07 '22 at 18:00
  • @Levente that may be a suggestion you make to Ubuntu, to see if they can fix the UX. – Thomas Ward May 09 '23 at 02:34
129

I had the same issue, the notification shows that the snap involved is snap-store.

If you run this in terminal, you will get a process ID (PID):

sudo snap refresh snap-store
error: cannot refresh "snap-store": snap "snap-store" has running apps (ubuntu-software), pids:
       2452

Then in the terminal kill that process and run it again:

kill 2452
sudo snap refresh snap-store

and it should succeed.

The currently highest rated answer suggests that you have this running or minimized, but it seems to me it is just running without a user starting it and it does not show running in the dock. It looks like a bug to me. As mentioned, it should fix itself after 14 days by killing the application, which may just be inconvenient if you're in the middle of using it.

Seems a work in progress, so perhaps some patience is in order, but if you don't have that, file a bug as described here: https://help.ubuntu.com/community/ReportingBugs

Vincent Gerris
  • 2,437
  • 1
  • 20
  • 14
51

Works for me:

  1. Kill "snap" at System Monitor
  2. sudo apt update && sudo apt upgrade
    
  3. sudo snap refresh
    
muru
  • 197,895
  • 55
  • 485
  • 740
4
# Close all open `snapd` process
sudo killall -s KILL snapd
sudo snap refresh
3

This worked for me:

sudo snap remove snap-store
sudo snap refresh
sudo snap install snap-store

I needed sudo in front of snap refresh to get it to work. This was the only option that worked for me. I also had to start Ubuntu Software app twice.

This also cleared a Snap Store pending update that could no be updated because the Snap Store was running.

Skylar
  • 3
2

Close all apps in your Ubuntu. Open Ubuntu Software app, under updates section, update the apps one by one. This trick worked for me.

Lalith Kumar
  • 121
  • 2
1

I solved the issue following these steps:

  1. log out from the graphical interface and start a command line session (CTR+ALT+F2 from the system login page).
  2. log in with your username and password and run sudo apt update && sudo apt upgrade and then sudo snap refresh.
  3. log out and start back the Ubuntu graphical interface (CTR+ALT+F).

I suppose that the issue is related to the gnome session which seems to run on snap.

Matteo
  • 11
  • 1
1

In my case was a "Pending update of 'deja-dup" snap...'" so my two penny solution is open a terminal and type:

sudo killall deja-dup-monitor
sudo snap refresh
deja-dup&

(latest command runs deja-dup's GUI so that deja-dup-monitor is automatically restarted)

lrkwz
  • 304
0

I'm using Ubuntu 20.04 and for me works:

sudo snap refresh snap-store

It will be downloading the necessary packages and at the end it should show you a message like:

snap-store (stable/ubuntu-22.04) 41.3-60-gfe4703a from Canonical✓ refreshed

I hope this helps someone else!

0

Please kill snap store first. Then run sudo snap refresh snap-store will be automatically updated.

0

All you need is to refresh the snap store. First, you need to kill it using its pid.

You can get it by running sudo snap refresh, get the pid from the output message:

error: cannot refresh "snap-store": snap "snap-store" has running apps
       (ubuntu-software), pids: 7274

Run: kill 7274. Then, run: sudo snap refresh again. That's it!

To be more specific to the question, use sudo snap refresh snap-store, by defining the application name.