How to install LXC 6 in Ubuntu 24.04 and Debian 12

Hello community. I plan to use LXC directly instead of Incus and to built open source tools directly for LXC*.

By looking into the packages for both Ubuntu 24.04 and for Debian 12, both seem to only provide 5.x versions.

What is the recommended way to install LXC 6.0.3 on both systems?


*The main reason is to provide a lightweight alternative for Incus without complexities like Docker because of OVN requirements, and with more opinionated defaults (bridge networks, LVM volumes, etc).

Would like to know, too. Probably need to figure out how to build it from source to check if the problem i’m experiencing with 5.x (Lxc-attach: Long output stops suddenly, possible bug? - #3 by laanwj) is solved there.

The packaging is up to the Linux distributions and their release cycle. LXC 6.x was released about a year go.
An important question is, do you have a requirement regarding the Linux distribution?

(Debian packager hat on)

Debian follows the LTS releases, and typically doesn’t backport newer LTS versions. trixie should be released in a few months, and will have lxc 6.0.4.

If you want to stick with Debian 12, you should be able to perform a local build without too much trouble (untested, but should work):

$ dget https://deb.debian.org/debian/pool/main/l/lxc/lxc_6.0.4-2.dsc
$ cd lxc-6.0.4/
$ dch --bpo
$ debuild

Be aware that you might want to drop 0003-apparmor-4x-userns.patch since Debian 12 has apparmor 3.0.8.

2 Likes