Comment 2 for bug 1982420

Revision history for this message
Justin Cattle (jocado) wrote :

Hi,

I hit this bug as well.

The problem seems to be that the multipass image for core20 builds, called snapcraft:core20, contains the version of libdevmapper1.02.1 from backports. It has the backports repo enabled, and an apt preferences to give it equal wight to the standard repos. apt will not downgrade libdevmapper1.02.1 automatically unless it's defined by policy or specifically instructed otherwise.

I installed a fresh machine, using the snapcraft:core20 image, and checked a few things:

root@test-20:~# cat /etc/apt/preferences.d/backports
Package: *
Pin: release a=*-backports
Pin-Priority: 500

root@test-20:~# grep backport /etc/apt/sources.list* -R
/etc/apt/sources.list:## Also, please note that software in backports WILL NOT receive any review
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
/etc/apt/sources.list:# deb-src http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse

root@test-20:~# dpkg -l |grep devmapper
ii libdevmapper1.02.1:amd64 2:1.02.175-2ubuntu4~ubuntu20.04.1 amd64 Linux Kernel Device Mapper userspace library

root@test-20:~# apt-cache policy libdevmapper1.02.1
libdevmapper1.02.1:
  Installed: 2:1.02.175-2ubuntu4~ubuntu20.04.1
  Candidate: 2:1.02.175-2ubuntu4~ubuntu20.04.1
  Version table:
 *** 2:1.02.175-2ubuntu4~ubuntu20.04.1 500
        500 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages
        100 /var/lib/dpkg/status
     2:1.02.167-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

When the image is used for snapcraft, some additional setup seems to be done that removes the backports repo. So, if anything then requires libdevmapper1.02.1, it will be the older version,and you get the apt solution which cannot be resolved in that case with the default policy.

This could be resolved by changing snapcraft to keep the backprts repo, or changing the image generation process to not include backports. Including backpacks seems like strange default choice for production to be honest.

Potentially therefor, this would be better logged under the multipass project, to highlight the backprots inclusion is problematic. I'm not sure who is responsible for multipless images though, perhaps the multipass code team are not.

I will try creating an issue over on https://github.com/canonical/multipass/issues

Cheers,
Just