How to update LXC/LXD to the latest version?

,

Hello,

I did a fresh install of Ubuntu Server 18.04. It came preinstalled with LXC/LXD version 3.0.3. Using apt update / apt upgrade did not make this any newer.

I then installed followed the instructions here and installed the snap version. This is 4.0.0. I then did lxd.migrate and everything works perfectly all the containers are running nicely.

However, I understand that the latest version is 4.0.3. Using apt update / apt upgrade makes no difference. I assume this is because it is a snap package. So I tried snap refresh. This also does not update LXC/LXD.

Is snap refresh the way to update snap packages? What am I doing wrong?

Thank you.

Hi!

The Deb version of LXD is at version 3.0.3 and it is not expected to get upgraded to 4.0. You did the proper thing to switch to the snap version, then lxd.migrate to complete the migration.

It is possible to have, let’s say a developer from Debian, to package LXD 4.0 as a deb package. And then decide whether to use that one. However, the snap version is a safe choice. There is a bit of learning curve, for example the snap version is not necessarily only LXD 4.0.
Run the following,

snap info lxd

It will show you the different channels, which correspond to different versions of LXD. You can switch forward from one version to a newer version. You may switch back two versions that are not too far apart.

By default you are tracking the latest/stable version. This one currently is at 4.0.0 (please verify).

As months go by, there will be 4.1, 4.2 and newer versions. By default, you will be upgraded automatically to the latesr version. If this is too fast for you, you can switch to the 4.0 channel, which does not receive any new features. Hence, it is conservative in favour of stability.

Thanks for your help.

I ran snap info lxd and it says that 4.0.0 is indeed the latest version.

So why does it say here on the forum that 4.0.3 is released? There is also an earlier post that 4.0.2 is released.

  1. There is a difference between LXC, LXCFS and LXD.
    All of these are different components, that interact.
    I only see:
  • LXC release 4.0.2
  • LXCFS release 4.0.3
  • LXD 4.0
  1. If you want to try the latest changes you would use the “edge” channel:

latest/edge: git-f8c0706 2020-04-18 (14723) 62MB -

But you should probably just use stable releases.

@simos: Sry for intervening, just saw you wanted to reply :slight_smile:

These are for LXC and LXCFS, which have independent minor-number versioning.
As far as I know, there is no minor number for LXD yet over 4.0.0. See https://github.com/lxc/lxd/releases

It is all good to get multiple replies. I think it is well-appreciated by the person asking the question to receive multiple quick quality answers. :raised_hand_with_fingers_splayed:

2 Likes

Indeed it is! Thank you all :smiley:

but the question stay: HOW TO UPDATE TO LXD 4.0 ??

finally, working… uuntu18 with lxd 4.0.3
how to, working, perhaps not perfect…

after fresh install, apt update/upgrade
check if lxd is installed by defaut by deb package, (3.0.3)

apt list --installed | grep ‘lxd/’

if present, stop lxd, all lxd and uninstall:

systemctl stop lxd
systemctl stop lxd.service
systemctl stop lxd.socket
apt purge lxd
apt autoremove
hash -r // force forget programm location
reboot
after reboot, new console:
snap info lxd // to get correct version channel
snap install lxd --channel=4.0/stable
snap list // to confirm correct lxd version useable from snap
hash -r
lxd version // now, it show 4.0.3 !

and you can continue with ‘lxd init’

question remain…
WHY they added snap tool and force lxd 3.0.3 deb package on install. ??
ubuntu users are as irresponsible as windows users ?? seen from canonical??

See my answer here Lxd version with snap , get 4.4, and show 3.0.3

exactly the same probleme…
i posted a complete resolution
ubuntu18 update lxd from 3.0.3 to 4.0.3 in french…