install deps
diff --git a/build_lxc.sh b/build_lxc.sh
index 657dd8a..c019d7e 100755
--- a/build_lxc.sh
+++ b/build_lxc.sh
@@ -12,9 +12,17 @@
 # Param string to pass to stack.sh.  Like "EC2_DMZ_HOST=192.168.1.1 MYSQL_USER=nova"
 STACKSH_PARAMS=${STACKSH_PARAMS:-}
 
-# Install cgroup-bin if we don't have it yet
+# Install deps
+apt-get install lxc debootstrap
+
+# Install cgroup-bin from source, since the packaging is buggy and possibly incompatible with our setup
 if ! which cgdelete | grep -q cgdelete; then
-    apt-get install cgroup-bin
+    apt-get install g++ bison flex libpam0g-dev
+    wget http://sourceforge.net/projects/libcg/files/libcgroup/v0.37.1/libcgroup-0.37.1.tar.bz2/download -O /tmp/libcgroup-0.37.1.tar.bz2 
+    cd /tmp && bunzip2 libcgroup-0.37.1.tar.bz2  && tar xfv libcgroup-0.37.1.tar
+    cd libcgroup-0.37.1
+    ./configure
+    make install
 fi
 
 # Create lxc configuration