pg_ldap_sync command not found

In this troubleshooting guide we learn how to fix pg_ldap_sync command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

pg_ldap_sync: command not found

or when using sudo you get the following error message

sudo: pg_ldap_sync: command not found

Solutions to pg_ldap_sync: command not found

How To Fix pg_ldap_sync: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu pg_ldap_sync is provided by ruby-pg-ldap-sync package.

ruby-pg-ldap-sync is:

LDAP is often used for a centralized user and role management in an enterprise environment. PostgreSQL offers different authentication methods, like LDAP, SSPI, GSSAPI or SSL. However, for any method the user must already exist in the database, before the authentication can be used. There is currently no direct authorization of database users on LDAP. So roles and memberships has to be administered twice.

This program helps to solve the issue by synchronizing users, groups and their memberships from LDAP to PostgreSQL. Access to LDAP is used read-only. pg_ldap_sync issues proper CREATE ROLE, DROP ROLE, GRANT and REVOKE commands to synchronize users and groups.

It is meant to be started as a cron job.

To fix this problem, we can install more using the command below.

sudo apt-get -y install ruby-pg-ldap-sync

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ruby-pg-ldap-sync.

sudo apt -y install ruby-pg-ldap-sync

Or if you have aptitude installed you can use the following command.

sudo aptitude install ruby-pg-ldap-sync

Summary

In this tutorial we learn how to fix pg_ldap_sync command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.