Snapd blocks dpkg in lxc container

When executing inside the lxc container:

# as root from the host
lxc exec CONTAINER_NAME-- sh -c "DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\" -y dist-upgrade 2>&1"

My script return this error:

CONTAINER_NAME snap install  lxd 5.20/stable >> ERR: error: too early for operation, device not yet seeded or device model not acknowledged

I look in the container to /var/log/apt/term.log

...
Setting up snapd (2.65.3+22.04) ...
Installing new version of config file /etc/apparmor.d/usr.lib.snapd.snap-confine.real ...
Installing new version of config file /etc/apt/apt.conf.d/20snapd.conf ...
snapd.failure.service is a disabled or a static unit not running, not starting it.
snapd.snap-repair.service is a disabled or a static unit not running, not starting it.

It seems that dpkg is freeze/block

I check systemd and it’s in starting state

Ubuntu 22.04

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

Linux gueryta38314c 5.15.0-125-generic #135-Ubuntu SMP Fri Sep 27 13:53:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

host snap information:

Name    Version       Rev    Tracking       Publisher   Notes
core22  20241001      1663   latest/stable  canonical#  base
lxd     5.20-f3dd836  27049  5.20/stable    canonical#  -
snapd   2.63          21759  latest/stable  canonical#  snapd

I use the same procedure (scripts, build system and build sequence) since Ubuntu 22.04 is out (I used it since Ubuntu 20.04).

Regards

I stopped my script just before the “apt-get dist-upgrade” script.

The snap information from dpkg in the container

root@CONTAINER_NAME:~# dpkg -s snapd
Package: snapd
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 99651
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 2.57.5+22.04
Replaces: snap-confine (<< 2.23), snapd-xdg-open (<= 0.0.0), ubuntu-core-launcher (<< 2.22), ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 1.9)
Depends: adduser, apparmor (>= 2.10.95-0ubuntu2.2), ca-certificates, openssh-client, squashfs-tools, systemd, udev, libc6 (>= 2.34), libfuse3-3 (>= 3.2.3), liblzma5 (>= 5.1.1alpha+20110809), liblzo2-2 (>= 2.02), libudev1 (>= 183), zlib1g (>= 1:1.1.4), default-dbus-session-bus | dbus-session-bus
Recommends: gnupg, fuse3 (>= 3.10.5-1) | fuse
Suggests: zenity | kdialog
Breaks: snap-confine (<< 2.23), snapd-xdg-open (<= 0.0.0), ubuntu-core-launcher (<< 2.22), ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 1.9)
Conflicts: snap (<< 2013-11-29-1ubuntu1)
Conffiles:
 /etc/apparmor.d/usr.lib.snapd.snap-confine.real 0558d50ed5bbcd8f424707a0aaeb6ae5
 /etc/apt/apt.conf.d/20snapd.conf e0e08d8267c66b9f81340dd6500cb67a
 /etc/profile.d/apps-bin-path.sh cf10aed8bb987ded8b7f4ba4303c1e9b
 /etc/xdg/autostart/snap-userd-autostart.desktop 4aaaa2fe36462a072a72e09cad553362
Description: Daemon and tooling that enable snap packages
 Install, configure, refresh and remove snap packages. Snaps are
 'universal' packages that work across many different Linux systems,
 enabling secure distribution of the latest apps and utilities for
 cloud, servers, desktops and the internet of things.
 .
 Start with 'snap list' to see installed snaps.
Built-Using: apparmor (= 3.0.4-2ubuntu2.1), libcap2 (= 1:2.44-1build3), libseccomp (= 2.5.3-2ubuntu2)
Homepage: https://github.com/snapcore/snapd

Regards,

I try this:

snap list
Name   Version  Rev    Tracking       Publisher   Notes
snapd  2.63     21759  latest/stable  canonical#  snapd


snap install lxd
error: cannot perform the following tasks:
- Run install hook of "lxd" snap if present (run hook "install": cannot perform operation: mount -t devpts --make-slave --make-private -o acl,relatime,kernmount,iversion,active,nouser,0xffffffff00000000 devpts /dev/pts: Permission denied)