Ubuntu - cubic: Install snap applications from chroot in customized iso fails


#1

Hello,
I try to customize a Lubuntu 18.04 iso using cubic.
Packages are installed in a chroot console:

  • Packages installed with apt are correctly installed in the iso (they can be then launched from the customized live usb), for exemple:
    apt install gimp

  • If a snap package is installed as follow from the same chroot console, it won’t be installed in the customized iso, but in the host system itself (here ubuntu 18.04), example:
    snap install darktable
    In this last case, darktable can be run from the host system and not from the live-usb.

Is it a cubic bug, or is there a right way to install the snap package in the iso with cubic?


#2

We have done no work to integrate with cubic, nor is it clear whether we should. As it stands I’d say it’s a cubic bug — if there is integration work that needs to happen on the snapd side, cubic hasn’t told us what it is nor asked for it.


#3

I also noticed this problem with Cubic. I customize the Ubuntu and Kubuntu ISO.
If I try to install an APP snap chroot, the APP installs in the host system.


#4

Also: what advantage would running a snap inside cubic have?


#5

For example: pre-install LibreOffice snap, then in chroot I remove LibreOffice “deb” to install the snap version.
Or preinstall spotify, as well as other APP snap.


#6

As you can see from the screenshots, snap shows what I have in the host system, apt shows what I have in the chroot system, in this case the Ubuntu ISO.
In this case I can’t preinstall any APP on the ISO chroot and then find it after installation on the system.


#7

I think that translates to “cubic does not support snaps”.


#8

on a sidenote i dont think even in official ubuntu images the seeding of snaps involves installing them in the target system, but instead they get downloaded to the seed directory of the image, assertions are copied in the right place and the seed.yaml file is adjusted … the actual installation of the snaps happens during first boot of the installed image AFAIK.

EDIT: the ubuntu code that seeds snaps into images is at
https://git.launchpad.net/livecd-rootfs/tree/snap-tool


#9

Suppose the target machine to install have no or poor internet connection.


#10

From the cubic chroot console, would it possible to download the snap packages, without installation’, store them in /opt directory of the iso? The idea would be to post install the snap packages from a customized ubuntu iso.


#11

no, you would have to use the correct directory, snapd does not look in /opt … and you will also have to modify the seed.yaml file in the correct way, similar to the livecd-rootfs code i linked above. best if you talk to the cubic guys so they implement it cleanly in their tool.