Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting this error using 12.04. When I run sudo lxc-execute -n foo -f lxc.example.conf ls, I get

/usr/lib/lxc/lxc-init: error while loading shared libraries: cannot open shared object file: No such file or directory

Any idea how to resolve this? I've installed libapparmor-dev and still no luck.

share|improve this question
Does the file in fact exist? If not, download, and place it there... – soandos Jun 12 '12 at 1:46

The library is in the libapparmor1 package:

% dpkg -S /usr/lib/
libapparmor1: /usr/lib/

And this is actually a dependency of lxc-init, which lives in the lxc package:

% dpkg -S /usr/lib/lxc/lxc-init
lxc: /usr/lib/lxc/lxc-init

% dpkg -s lxc | grep Depends
Depends: upstart-job, libapparmor1 (>= 2.6~devel), libc6 (>= 2.14), libcap2 (>= 2.10), apparmor, bridge-utils, dnsmasq-base, iptables, rsync

Do you have a broken installation? This might help:

apt-get update
apt-get install -f
share|improve this answer

So after some playing around, what I ended up trying was copying the on my host machine into the guest container and it seems to have worked. So the problem wasn't actually on the host machine that I was trying to run lxc-execute on. In the end, for our build script, I now install libapparmor-dev into the container's file system:

chroot $JAIL /bin/sh -c "apt-get -yf install libapparmor-dev"

After that, I am able to run lxc-execute on that container. $JAIL being the directory where it's located.

And for further reading, here's a post I found about why apparmor is now a dependency:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.