Update container OS?

Hi all.

Is it possible to update existing container from ubuntu 16.04 to 18.04 ? I tried ‘do-release-upgrade’ and it said ‘Must be connected to a terminal’.


There are three main ways to get a shell to a container. lxc exec is one of them.
Try with ssh and lxc console as well.

These three ways get you a different type of try. Run tty in each to see the difference.

Hi, I tried

  1. lxc exec container – sudo do-release-upgrade

  2. lxc exec container bash

sudo do-release-upgrade.

Both result the same ‘Must be connected to a terminal’.

I did an edit to my original reply. The other two ways are

  1. lxc console (you need to set up a password to the non-root account in the container in order to log in).
  2. SSH.

Thanks simos, lxc console works !

Thank you :wink:

1 Like

I do:

lxc exec container-name -- script /dev/null -c do-release-upgrade