Skip to content

install pygit2 + libgit2 w/ SSH support on ubuntu

I wanted to use Saltstack‘s gitfs to easily reference salt formulas from my gitolite repository over ssh using key-based authentication. In order for salt-master to do this, you need pygit2, which needs libgit2, which isn’t yet packaged by ubuntu. You can download a libgit2 deb file, but that doesn’t have libgit2 compiled with SSH support, so I had to compile from source:

#!/bin/sh
sudo aptitude install pkg-config libssh2-1-dev libhttp-parser-dev libssl-dev libz-dev
wget https://github.com/libgit2/libgit2/archive/v0.22.0.tar.gz
tar xzf v0.22.0.tar.gz
cd libgit2-0.22.0/
cmake .
make
sudo make install
sudo pip install pygit2