Can't remove core18 snap

I am cleaning up my fresh Ubuntu 20.04 install and I can't seem to remove core18 snap.

$ snap list
Name    Version   Rev    Tracking         Publisher   Notes
core18  20200427  1754   latest/stable    canonical✓  base
lxd     4.1       15359  latest/stable/…  canonical✓  -
snapd   2.45      7777   latest/stable    canonical✓  snapd

$ snap remove core18 
error: cannot remove "core18": snap "core18" is not removable: snap is being used by snap lxd.

What IS core18 and why do I need it so much that it won't let me remove it? Most online references I found say it is for IoT or embedded devices. Since my workstation is such a device I don't see why I need it. I am planning to use lxc containers but why do I need core18 for that?


Solution 1:

Snap packages are based on a runtime, which is either core (Ubuntu 16.04), core18 (Ubuntu 18.04), core20 (Ubuntu 20.04).

A developer of a snap package can choose to base it on a specific runtime version. The choice of core18 is a good option because the runtime includes most of the stuff that LXD needs (at the appropriate versions), and thus the LXD snap package saves space.

If you install more snap packages, and they also use core18, then you are saving space because the same runtime is reused.

If you install GUI snap packages, then they will likely pull in the additional runtime for GNOME. Again, these are shared among other GUI snap packages.