Removing postgresql (9.4+166bzr2) ... Removing postgresql-9.4 (9.4.3-0ubuntu0.15.04) ... Purging configuration files for postgresql-9.4 (9.4.3-0ubuntu0.15.04) ... Dropping cluster main... Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_dropcluster line 66. dpkg: error processing package postgresql-9.4 (--purge): subprocess installed post-removal script returned error exit status 2