How do I remove an incomplete or broken snap installation of nextcloud on a Raspberry Pi?

The snap command is actually made up of two components, server and client. You're interacting with the client. When you cancelled the install operation on the client side that's the only place you cancelled it-- the client. So it stopped showing you that it was installing, but it was still installing (this is a bug). (Update: This bug was fixed in snapd v2.20.1.)

On the server side, all of this stuff is happening in "changes." You can read more about them here, but for your purposes, you want to just abort this specific change. To do that, run:

$ snap changes
<snip>
203  Doing   2016-06-24T12:17:45Z  -  Install "nextcloud" snap

Note the ID, 203, and the fact that it's "Doing" it right now. To abort that operation, you use the change ID:

$ sudo snap abort 203

And the change should stop. However, I must say that the fact that the change froze partway through does not bode well for your ability to abort it. If it doesn't work, perhaps try rebooting. If that still doesn't seem to have fixed it and you're okay losing all your snaps and their data, you can completely reset the snapd state with this script.


When you see an erroneous snap install and you did not install the app, run the command

sudo snap changes

and look for the ID of the installed app.
After that, run the command

sudo snap remove app_name 

and return to

sudo snap install app