Thanks Phil for pointing out that there is some `dpkg-divert` at play
(https://git.launchpad.net/livecd-rootfs/tree/live-build/ubuntu-
server/hooks/01-unminimize.chroot_early?h=ubuntu/noble).

I think the issue is due to the `dpkg-diversion` being done prior to
upgrading the `lxd-installer` package and the diversion is presumably
not respected due to confusion between `/usr/sbin/lxd` and `/sbin/lxd`.
Here's the reproducer:

```
$ lxc launch ubuntu-minimal-daily:24.04 c1
$ lxc shell c1
root@c1:~# dpkg-divert --add --divert /usr/sbin/lxd.REAL --rename /usr/sbin/lxd
Adding 'local diversion of /usr/sbin/lxd to /usr/sbin/lxd.REAL'
root@c1:~# ln -s /bin/true /usr/sbin/lxd
root@c1:~# ll /sbin/lxd* /usr/sbin/lxd*
lrwxrwxrwx 1 root root   9 May 22 14:20 /sbin/lxd -> /bin/true*
-rwxr-xr-x 1 root root 372 Jan 11 16:58 /sbin/lxd.REAL*
lrwxrwxrwx 1 root root   9 May 22 14:20 /usr/sbin/lxd -> /bin/true*
-rwxr-xr-x 1 root root 372 Jan 11 16:58 /usr/sbin/lxd.REAL*
root@c1:~# sed -i 's/noble-backports/noble-proposed/' 
/etc/apt/sources.list.d/ubuntu.sources
root@c1:~# apt-get -qq update
root@c1:~# apt-get install lxd-installer -t noble-proposed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
  lxd-installer
1 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
Need to get 3926 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 lxd-installer 
all 4ubuntu0.1 [3926 B]
Fetched 3926 B in 0s (106 kB/s)         
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 12555 files and directories currently installed.)
Preparing to unpack .../lxd-installer_4ubuntu0.1_all.deb ...
Unpacking lxd-installer (4ubuntu0.1) over (4) ...
Setting up lxd-installer (4ubuntu0.1) ...
root@c1:~# ll /sbin/lxd* /usr/sbin/lxd*
-rwxr-xr-x 1 root root 589 May  7 23:33 /sbin/lxd*
-rwxr-xr-x 1 root root 372 Jan 11 16:58 /sbin/lxd.REAL*
-rwxr-xr-x 1 root root 589 May  7 23:33 /usr/sbin/lxd*
-rwxr-xr-x 1 root root 372 Jan 11 16:58 /usr/sbin/lxd.REAL*
```

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061017

Title:
  lxd-installer: permission error not handled and lxd snap not installed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd-installer/+bug/2061017/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to