So yes, if you want the upstream version number in a generic way which works with older and newer lxc, you'll need something like what you listed above.
However, note that in most distributions, the upstream version number is mostly irrelevant due to the amount of cherry-picking that's done, The package version (dpkg -l lxc) tends to be much more reliable for that. In LXC's case, Ubuntu's 0.8 was very very close to the final 0.9 and 0.9 was also heavily patched to the point where it was almost identical to 1.0~alpha1, so only checking the upstream version likely won't give you what you want. With LXC 1.0, Ubuntu is going to be extremely close to what upstream offers, instead getting bugfixes releases done upstream rather than manually cherry-picking fixes, so that should limit the problem a bit, but still, checking for version usually isn't recommended. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to lxc in Ubuntu. https://bugs.launchpad.net/bugs/1273689 Title: lxc-version is missing since 1.0.0beta3 - now lacking a programatic way to query lxc version To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1273689/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs