What is difference between os snap, base snap and core snap

Hi,

I am trying to understand the difference between os snap, base snap and core snap.
Any pointer wud helpful.

Thanks
Mari

1 Like

i feel they are synonymous.

os snap and base snap are actually synonymous based on the context of the snap … the core/core18/core20 snaps are the execution environment if you install snap packages on top of a classic distro, in that context they are base snaps.
These same snaps are also used as the root filesystem of Ubuntu Core images, in that context they are os snaps…

The names core, core18 and core20 tie a snap package to a particular release that was used for the base: keyword in snapcraft.yaml when building a snap package.

core -> 16.04, core18 -> 18.04 and core20 -> 20.04

All three are base and os snaps but are indeed different in their content.

Hi ogra,

Can you point out what “os snap” really does ? From the official document, it provides a running environment with a set of libraries. Do you have a list of these libraries ?

If i want to only integrate snapd service to our custom board/kernel, without os snap. What will i miss without os snap ?

I guess “os snap” provides the python / go running environment, is it true ?

Thanks,
Yafeng

A list of libs can be found like:

sudo find /snap/core/current/ -name '*.so*'

If you want to know which packages these libs originally came from:

cat /snap/core/current/usr/share/snappy/dpkg.list

(note though that most of the packages gets removed during build again, only what is actually needed is left inside the snap)

you dont miss anything but you duplicate stuff … you can indeed just roll your own rootfs instead of running Ubuntu Core … but if you install snaps the required core snap that was defined via the base: statement in snapcraft.yaml will always be pulled in to run the snaps you install. Using Ubuntu Core just saves you from having to maintain the underlying OS alongside.

there is a python interpreter inside the core snaps, yes, but only a very basic set of modules, your application snap (or a content snap) needs to ship the required modules. Go does not use/need an interpreter to my knowledge.

Does that mean even though i do not install os snap previously, os snap would be installed silently when i run other snaps ? If so, i do think os snap is a must on classic system, because most of snaps depends on core, right?