For debugging or testing new upstream versions of LXC, it is handy to install LXC from source and overwrite (if it exists) a LXC version installed through apt.
The following steps explain how to compile and install LXC from source on an Ubuntu 14.04 LTS where the same directory paths (as known from the installation through the package) are used.
Clone git repository or download current zip of master branch:
$ git clone https://github.com/lxc/lxc.git
or
$ wget https://github.com/lxc/lxc/archive/master.zip; unzip master.zip
Install required packages to build LXC:
$ sudo apt-get install build-essential automake autoconf pkg-config docbook2x libapparmor-dev libselinux1-dev libcgmanager-dev libpython3-dev python3-dev libcap-dev
Change into the cloned or unzipped repository and compile:
$ if [ -d lxc ]; then cd lxc; elif [ -d lxc-master ]; then cd lxc-master; fi
$ ./autogen.sh
$ ./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu --with-rootfs-path=/usr/lib/x86_64-linux-gnu/lxc --sysconfdir=/etc --localstatedir=/var --with-config-path=/var/lib/lxc --enable-python --enable-doc --disable-rpath --enable-apparmor --enable-selinux --disable-lua --enable-tests --enable-cgmanager --enable-capabilities --with-distro=ubuntu
$ make; sudo make install
You can then verify that the lxc scripts are built against the new version (as of today the current version in master is 1.1.0-alpha2):
$ ldd /usr/bin/lxc-start | grep liblxc
liblxc.so.1 => /usr/lib/x86_64-linux-gnu/liblxc.so.1 (0x00007f2c9e58b000)
$ ll /usr/lib/x86_64-linux-gnu/liblxc.so.1
lrwxrwxrwx 1 root root 22 Nov 26 13:31 /usr/lib/x86_64-linux-gnu/liblxc.so.1 -> liblxc.so.1.1.0.alpha2
ck from Switzerland wrote on Oct 18th, 2016:
Hi El Mario, configure is on the page, too :-) But I didn't simply launch "./configure", I added a bunch of paths into the command.
ElMario from wrote on Oct 17th, 2016:
Hello, and thank you for the help!
I never know where to start with all these scripts and buildtools..
It seems like you forgot one step:
After ./autogen.sh we need to ./configure
Bye :)
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office OpenSearch PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder