[Bug 2104201] Re: LXD installer attempts to install when LXD snap is installed & disabled
Simon Déziel
2104201 at bugs.launchpad.net
Wed Mar 26 12:57:11 UTC 2025
@Wesley, on more recent versions, if you are in an interactive session,
you get a confirmation prompt:
```
$ lxc launch ubuntu-minimal-daily:25.04 c1
Launching c1
$ lxc shell c1
root at c1:~# snap install lxd
root at c1:~# snap disable lxd
lxd disabled
root at c1:~# lxc ls
Would you like to install LXD snap now (Y/n)? y
Installing LXD snap, please be patient.
/usr/sbin/lxc: 49: exec: /snap/bin/lxd.lxc: not found
```
And then it fails due to the `snap install lxd` happening behind the
scene failing:
```
root at c1:~# journalctl -f
Mar 26 12:47:48 c1 lxd-installer-service[1972]: + snap install lxd --channel=5.21/stable/ubuntu-25.04
Mar 26 12:47:48 c1 snapd[741]: api_snaps.go:467: Installing snap "lxd" revision unset
Mar 26 12:47:48 c1 lxd-installer-service[1980]: snap "lxd" is already installed, see 'snap help refresh'
Mar 26 12:47:48 c1 lxd-installer-service[1972]: + break
Mar 26 12:47:48 c1 lxd-installer-service[1972]: + echo 1
```
Refreshing doesn't even work, it needs to be re-enabled:
```
root at c1:~# snap refresh lxd
error: cannot refresh "lxd": refreshing disabled snap "lxd" not supported
root at c1:~# snap list lxd
Name Version Rev Tracking Publisher Notes
lxd 5.21.3-75def3c 32455 5.21/stable canonical✓ disabled
root at c1:~# snap enable lxd
lxd enabled
```
However, I'm assuming that since you explicitly `snap disable lxd`, you
don't want lxd-installer to re-enable it?
I'm assuming you would like lxd-installer to be smarter at detecting
LXD's snap presence? If so, I'm thinking of adding an early exit on
`snap list lxd >/dev/null 2>&1` returning 0. WDYT?
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to lxd-installer in Ubuntu.
https://bugs.launchpad.net/bugs/2104201
Title:
LXD installer attempts to install when LXD snap is installed &
disabled
Status in lxd-installer package in Ubuntu:
New
Bug description:
Install and disable LXD in Ubuntu 24.04
```
sudo snap install lxd
sudo snap disable lxd
```
Then run a command with lxc:
```
$ lxc ls
Installing LXD snap, please be patient.
```
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd-installer/+bug/2104201/+subscriptions
More information about the foundations-bugs
mailing list