Create a gist now

Instantly share code, notes, and snippets.

Install libxml2-python on ubuntu 14.04 by pinning libxml2/libxslt1.1 to precise
#!/usr/bin/env bash
# enable precise source
echo "deb http://archive.ubuntu.com/ubuntu precise main universe" \
>> /etc/apt/sources.list
# update system
apt-get -y -qq --force-yes update \
# install needed deps
apt-get -y -qq --force-yes install \
python-setuptools \
build-essential \
wget \
python-dev \
libxml2/precise \
libxml2-dev/precise \
libxslt1.1/precise \
libxslt1-dev/precise \
zlib1g-dev
# install package that depends upon libxml2 and libxslt1.1 to show that both
# will not be upgraded
apt-get -y -qq --force-yes install \
libxmlsec1 \
libxmlsec1-dev \
libxmlsec1-openssl
# install pip
easy_install pip
# install offending package
wget ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.21.tar.gz
pip install libxml2-python-2.6.21.tar.gz
# install other binding that depends on libxml2 and libxslt1.1
pip install lxml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment