How to get the os-release of the image

Hi,

we want to display the ubuntu core image version inside a snap.
When we reference /etc/os-release or /usr/lib/os-release we get the information provided by the core snap that is defined in the base property of the snap. So a base: core20 snap would show core20 even the image is based on ubuntu core 18.

How to get the information from the actual os?

Thanks.

While digging into it we found that system-observe interface provides the information in: /var/lib/snapd/hostfs/etc/os-release

Resolved.

1 Like