postgres pg_upgrade 9.2 to 9.5 problem
The issue repeated for me on a legacy PostgreSQL 9.2 to 11 upgrade. The pg_upgrade would fail with: FATAL:  unrecognized configuration parameter "unix_socket_directory"

Blog entry at https://altinukshini.wordpress.com/2018/05/03/upgrade-postgres-9-2-to-9-6-in-centos-7-bold-lines/ gives the solution, ditto:

mv /usr/bin/pg_ctl{,-orig}
echo '#!/bin/bash' &gt; /usr/bin/pg_ctl
echo '"$0"-orig "${@/unix_socket_directory/unix_socket_directories}"' &gt;&gt;     
   /usr/bin/pg_ctl
chmod +x /usr/bin/pg_ctl


Run now the pg_upgrade (as postgres user), the unix_socket_directories error should be gone.
Lastly, (as root) revert:
mv -f /usr/bin/pg_ctl{-orig,}