Use PGXN to install pg_repack on postgres 9.6 on top of Ubuntu 14.04 So I have Ubuntu 14.04 with postgres 9.6 and I wanted to install pg_repack so I did 

sudo apt-get install pgxnclient`
sudo pgxn install pg_repack


but I got an error (sorry I forgot the error) and I found a site saying I need

sudo apt-get install postgresql-server-dev-all
sudo apt-get install postgresql-common


I suspect that one or both of those came in as Postgresql 10 because when I did

sudo pgxn install pg_repack


it seems to work except for that it is putting the files in /usr/lib/postgresql/10/bin when I'm still running 9.6 server.

Can I just move that to /usr/lib/postgresql/9.6/bin or is there something specific about it to postgres10 that won't work if I just move it?

Secondly, how do I configure pgxn to use 9.6 and not 10?

The website here is dead so I imagine there's documentation out there that I can't get.
pgxn will install using the PostgreSQL associated with whatever pg_config it finds first in $PATH.  If you set your PATH (either permanently or temporarily) to list first the directory containing that pg_config then that should fix the problem

sudo su
PATH=/some/version/postgres/bin:$PATH
pgxn install pg_repack