How to close the Snap Store to allow Snapd to update it

For several reasons, closing the Snap Store (Ubuntu Software) window is not enough to close the program itself. Instead, it will be kept running in background.

To fully close it, just open it, do click in the “Ubuntu Software” text in the left part of the top bar (if your language isn’t English, it will be translated), and choose “Quit” (also translated). It will fully close the Snap Store and you will be able to update it using “sudo snap refresh snap-store”.

14 Likes

I was going to post something along this same line. I figured out how to end the snap store using the “System Monitor” application, but this is NOT something a beginning Linux user would instinctively know to do. You need to come up with a far more user friendly way to allow the Snap Store to be updated so a newbie isn’t nagged with those “you must close the snap store so it can be updated” (I know that’s not the actual wording) messages.

11 Likes

Hi @SergioCostas,

I tried this but it did not fully end the snap-store process, so I was not able to update it.
Before that I had tried a system reboot but to no avail it would seem.

I had to end the process (either through kill <snap-store processId> or using the system monitor app), and I was then able to run sudo snap refresh snap-store.

As @jaime-cruz states, a more user-friendly way of updating the snap-store would be very welcome.

5 Likes

The last versions of SnapStore include a parameter for that; just typing in the terminal:

snap-store --quit-on-close-for-update

should do the trick.

6 Likes

Great advice, this quit also works for other apps that will tend to run in background. Fox emaple Rhythmbox or Feedreader. Both run in the background process to either play music or look for new articles/posts to his the RSS feeds respectively.

I had to kill the snap store pid, then use
‘sudo snap refresh snap-store’
Nothing else would work. Ubuntu 22.04

6 Likes

None of the suggestions above works for me.

sudo snap-store --quit-on-close-for-update
[sudo] password for wim:
mkdir: cannot create directory ‘/run/user/0’: Permission denied
Warning: Schema “org.gnome.system.locale” has path “/system/locale/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy” has path “/system/proxy/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.http” has path “/system/proxy/http/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.https” has path “/system/proxy/https/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.ftp” has path “/system/proxy/ftp/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.socks” has path “/system/proxy/socks/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
13:17:26:0326 GLib-GIO g_app_info_get_name: assertion ‘G_IS_APP_INFO (appinfo)’ failed
Unknown option --quit-on-close-for-update
wim@wim-System-Product-Name:~$ sudo snap refresh snap-store
error: cannot refresh “snap-store”: snap “snap-store” has running apps
(ubuntu-software), pids: 2288
wim@wim-System-Product-Name:~$ sudo snap refresh snap-store
error: cannot refresh “snap-store”: snap “snap-store” has running apps
(ubuntu-software), pids: 2288

1 Like

Elsewhere I found this advice, which at least did not give me an error message in the terminal, so may just have worked:

You’ll have to end up killing the snap store as simply closing the window keeps the store running in the background:

killall snap-store

Then tell snapd to update all snaps:

sudo snap refresh

12 Likes

killall snap-store

Tha’s what I had to do couple of days ago when we got the Snap Store update.

3 Likes

Awesome, worked excellent.
Thank You _ very much appreciated.

Choosing “Quiet” isn’t working for me Ubuntu 20.04.5 LTS, so only option for me was:
snap-store --quit
sudo snap refresh

3 Likes

I too ran into the same issue. I was only able to update snap-store (Ubuntu Software) by running:

$ killall snap-store
$ sudo snap refresh snap-store

@SergioCostas I tried the command you suggested, but as of version “41.3-66-gfe1e325”, it doesn’t look like it’s working or available yet.

$ snap-store --quit-on-close-for-update
Unknown option --quit-on-close-for-update
5 Likes

Sorry, my fault: I presumed that that patch was merged, but it wasn’t. So that option isn’t available… yet.

3 Likes

I hope it becomes the default. It wouldn’t do to have to start the snap store from the command line rather than have it start up automatically without it.

This works, Many thanks!!!

Thanks wmrp. It`s works. :+1:

This worked perfectly. Thank you.

Users are still running into this three months later – do we need to visit every user and ask them to run manual commands to update? Or just hope we catch them at the next LTS upgrade cycle?

3 Likes

This one worked for me. Thankyou

It is not a solution for the stable channel, but the new flutter based snap-store does not have this problem

sudo snap refresh snap-store --channel=preview/edge

edit: in order to refresh the snap you still need to close it but you can just close the window however you like

6 Likes