Ubuntu Core 16/18 remove "required-snap"

Hello,
Is there any way that a “required” snap can be removed, by any chance?
Because it seems that I made a mistake during image creation, and deployed some images, where it cannot be reflashed over again.
The error goes like this:

admin@hass-hub:~$ snap remove hello
error: cannot remove “hello”: snap “hello” is not removable: snap is required
admin@hass-hub:~$

Any way to circumvent this?
It seems like that a “required” snap is causing some problems, the only fix for now is to remove and re-install it, (snap remove, snap install) but since I built an image that includes this snap, I cannot do this “fix”.
This is on Ubuntu Core 16/18.

Is the snap listed as required in the model? If so, you can remodel to a new revision which no longer lists the snap. Once that is complete you will be able to remove it.

Yes, the “hello” snap is added as an “required” snap.
What do you mean by remodelling the model? Just updating it?

Yes, I can change the model, but this will not help for devices already in the field?

Do I need to update something, (gadget/kernel?) Or can I manually change something on the current deployed image?
Take into mind, the current deployed images in the field does not neccesarily have internet access, so we are using ssh to do maintenance when required.

You need to generate a new model assertion, but bump its revision number (or just add "revision": "2" if there was none before) and remove hello from required-snaps. Then deploy the assertion to a test device, run snap remodel your-new-assertion.model. Since it’s a simple revision bump with required snaps change, the device should not reboot and its serial number will remain unchanged. Once the remodel is complete you should be able to run snap remove hello.

1 Like

Thanks, I tried remodeling my current testing image, and seems to work, could then remove the “hello” snap. I’m glad that we can remodel, when needed in Ubuntu Core.