ldap2pg main packaging format is a regular Python package, available at PyPI. ldap2pg tries to reduce dependencies and to be compatible with versions available from official distributions repositories.

Pure python

You can fetch all dependencies with PIP. Choose either pip3 or pip2.

# apt install -y libldap2-dev libsasl2-dev python3-pip
# pip3 install ldap2pg psycopg2-binary

On CentOS 7 from RPM

On CentOS 7, either PGPG YUM repository and Dalibo Labs YUM repository offer RPM package for ldap2pg. The repositories does not provide the same packaging. Dalibo Labs is upstream, packages are more up to date. PGDG is more common and often always available on your host.

For using Dalibo Labs packaging:

# yum install ldap2pg
# ldap2pg --version

For using PGDG YUM packaging:

On CentOS 7 from source

You should run ldap2pg with Python2.7 to use packaged dependencies.

# yum install -y epel-release
# yum install -y python2-pip python-ldap python-psycopg2 python-wheel PyYAML
# pip2 install --no-deps --upgrade ldap2pg
# ldap2pg --version

On CentOS 6

PGDG repository provides RPM packages for CentOS6.

To install from source, you have to run ldap2pg with Python2.6 and some forward compatibility dependencies.

# yum install -y epel-release
# yum install -y pyton-argparse python-pip python-ldap python-logutils python-psycopg2 PyYAML
# pip install --no-deps --upgrade ldap2pg
# ldap2pg --version

On Debian 9 (jessie)

On Debian jessie or later, you can use regular Python3 and wheels.

# apt install -y python3-pip python3-psycopg2 python3-yaml
# pip3 install --no-deps ldap2pg python-ldap

On Debian 7 (wheezy)

On Debian wheezy, you have to use Python2.7.

# apt install -y python-pip python-psycopg2 python-yaml python-ldap
# pip install --no-deps ldap2pg