11

Is there a way of disabling a snap from automatically starting?

I installed the microk8s snap, which is very cool, however it starts automatically every time I restart my computer. I can stop it when I have logged in but it eats all my CPU and chews up disk time. Sometimes it can take several minutes just to get a gui up.

I can stop the service using microk8s.stop once I get a terminal running.

I want to be able to start the snap when it's needed, but this seems to integrate as a core service.

Any help is definitely appreciated!

MrMowgli
  • 295
  • 1
  • 3
  • 12

3 Answers3

8

To disable a service, use the systemctl command such as systemctl disable snap.snapname.application.service. For example to disable the apache webserver inside the nextcloud snap - use systemctl disable snap.nextcloud.apache.service. You can get a list of the services using snap services.

You can completely disable snaps with snap disable (name) and enable when you need it with snap enable (name).

You can see the names of services in snap info (snapname).

popey
  • 24,549
3

One more detail. If you edit X-GNOME-Autostart-enabled to false on Microsoft Teams, the app will change it to true when you execute it. To prevent that I cleared the write attribute of the .desktop file. Now MS Teams can't write to it.

Francisco
  • 31
  • 1
2

I'd prefer that snaps require to ask for specific permission for autostart....

best I've found is some .desktop files that have an entry in them for autostart.

I have found in ~/.config/autostart/ some snaps with a .desktop file there. SkypeForLinux for example.

Other times in ./snap/$snapname/current/autostart/ I've found Microsoft Teams in there.

Jonathan
  • 133