Installing LXD 3.1 on 18.04

Tried installing LXD 3.1 by doing:
sudo snap install lxd --channel=candidate
Checking the version it still shows 3.0.0.
On it shows that candidate is 3.1.

Try snap info lxd to see the available versions.
If you already have LXD installed, there is a way to switch between channels and not uninstall.

I tried that too below you can see the output. But in spite of it being installed when I run lxd --version it shows 3.0.0 and for lxc too it shows 3.0.0

snap-id:   J60k4JY0HppjwOjW8dZdYc8obXKxujRu

tracking: latest/candidate
refreshed: 2018-05-15T17:54:56Z
installed: 3.1 (7109) 56MB -
stable: 3.0.0 (6954) 56MB -
candidate: 3.1 (7109) 56MB -
beta: ↑
edge: git-d0d66b4 (7119) 56MB -
2.0/stable: 2.0.11 (6627) 27MB -
2.0/candidate: 2.0.11 (7099) 28MB -
2.0/beta: ↑
2.0/edge: git-e48b686 (7029) 26MB -
3.0/stable: 3.0.0 (6960) 56MB -
3.0/candidate: 3.0.0 (7104) 56MB -
3.0/beta: ↑
3.0/edge: git-8669276 (7009) 56MB -

Ubuntu 18.04 comes already with LXD 3.0, as a DEB package.
When you install the snap package, there is a separate step to remove the existing DEB installation and replace it with the snap version.

You do that step by running:

sudo lxd.migrate

You might also remove the LXD packages manually as well. They are lxd-server and lxd-client.

Thanks for a reply.
I did minimal install and then installed lxd 3 via snap. So my system so not have deb. I will try lxd migrate though.

You can run this,

$ which lxd lxc

and it will show you whether it’s the snap or the deb package. In this example, it’s the snap.

Thanks for the help. Finally found that need to purge lxd package and then re-install the snap. I stumbled across this issue, I think as I was not paying attention to package.

Just for the people struggling with it.
Do not try to manually remove deb and then run lxd.migrate. it gives errors.
Just install snap package and then as mentioned type lxd.migrate.
At last it will ask if need to remove the old LXD, select yes for it. Once you have done that lxd with snap will work with snapctl.

1 Like

Oh yes, absolutely. lxd.migrate relies on the deb still being installed and running in order to look into your existing setup, confirm that everything looks good an is supported and then move your data over to the snap.

1 Like