Like many of you, I'm getting the annoying notification that there's a pending update of snap-store:
Pending update of "snap-store" snap
Close the app to avoid disruptions (13 days left)
There are plenty of suggestions at that question as to how to make the notification go away, but it will happen all over again once there's a new update to snap-store.
Question
How can I prevent snap-store from automatically starting when I log in without uninstalling it?
Cause of the problem
As best as I can tell, the reason snap-store starts automatically is because the current version has an autostart file located at ~/snap/snap-store/current/.config/autostart/ubuntu-software-service.desktop
~/snap/snap-store/current
is just a symlink that points to the currently installed version of snap-store:
ls -ld ~/snap/snap-store/current
lrwxrwxrwx 1 user user 3 Sep 28 08:43 /home/user/snap/snap-store/current -> 599
I'm not sure when the autostart file was added, but I can see as of version 41.3-66-gfe1e32544+ (revision 582), the file wasn't there:
ls ~/snap/snap-store/582/.config/autostart
ls: cannot access '/home/user/snap/snap-store/582/.config/autostart': No such file or directory
And it is there in revision 592:
$ ls ~/snap/snap-store/*/.config/autostart
/home/user/snap/snap-store/592/.config/autostart:
ubuntu-software-service.desktop
What I've tried
This answer suggests that to prevent a snap from starting at boot, the service needs to be disabled. But there's no service for snap-store.
The normal way to prevent an application from automatically starting is to create a custom autostart file, which should take precedence over the system one. So that's what I did:
$ cat ~/.config/autostart/ubuntu-software-service.desktop [Desktop Entry] Name=Ubuntu Software Exec=snap-store.ubuntu-software --gapplication-service %U OnlyShowIn=GNOME;Unity; # Disable autostart Hidden=true
Unfortunately, it doesn't work.
I tried creating a script in /etc/profile.d/ to kill snap-store, but it runs before logging in, before snap-store has started
Current workaround
cat ~/.config/autostart/stop-snap-store.desktop
[Desktop Entry]
Type=Application
Name=Stop Ubuntu Software
Exec=snap-store --quit
X-GNOME-Autostart-Delay=30
OnlyShowIn=GNOME;Unity;
NoDisplay=True
Or to make the change for all users, put stop-snap-store.desktop in /etc/xdg/autostart/