What is the terminal command to stop a running snap package program?

I have a snap package program running, but it refuses to stop, it still has its icon in the tray area, but no matter what I do it will not end. That made me think of these questions:

  1. Is there a terminal command to see the current status (running, not running, etc.) of a snap package?

  2. Is there a a terminal command to end a snap package, similar to the kill command?

1

2 Answers

A running snap is a process like any other. 1) The snap will appear among the other running processes in the output of top, htop, System monitor, etc. 2) You therefore can also use the kill command or one of the tools mentioned to stop the snap like you can for other processes.

In addition to vanadium's answer, snap has some additional management options (this may or may not be useful for your particular scenario, but for completeness sake I think it is worth mentioning).

Use snap services to lists all the services added to the system by the currently installed and enabled snaps.

Service Startup Current Notes
canonical-livepatch.canonical-livepatchd enabled active -
lxd.activate enabled inactive -
lxd.daemon enabled inactive socket-activated

The start and stop commands control whether a service should be currently running:

$ sudo snap stop lxd.daemon
Stopped.
$ sudo snap start lxd.daemon
Started.

Finally, if a snap has undesired behaviour, you can disable it and later enable it again. This avoids having to remove and reinstall them in the system:

$ sudo snap disable vlc
vlc disabled
$ sudo snap enable vlc
vlc enabled

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like