I have an older laptop where the root partition is separate from /home, and isn’t very large in total size. Recently I installed snapcraft 3, lxd and multipass snaps (replacing older apt-installed snapcraft 2 and lxd), and tried new builds of a snap I’m responsible for which generates fairly large build artefacts (not included in the final snap).
The result is that the containerized storage generated by lxd and multipass has now taken up a substantial chunk of the root partition. Freeing this seems non-trivial: for example lxc storage delete default won’t work because it’s in use by the default profile, and the default profile itself cannot be deleted.
Can anyone advise how to effectively clean up all the images allocated by lxd and multipass? I’m fine with uninstalling everything, removing all images, and starting from scratch, but I would also be fine with finding some way to remove files from inside the images if that would shrink them.
You can remove the LXD snap with the purge option and will take away the storage.
If for some reaaon you would rather keep the installation, you can create a new storage device that is based on 'dir`, then rename it to default and remove the old one.
If you are already using the dir storage, then you can remove all you can find in lxc list and lzc image list, and disk space will to go zero.
With multipass, you remove all VMs, then multipass purge to expunge them.