Postgres upgrade 9.2 to 10 failure bash-4.2$ /usr/pgsql-10/bin/pg_upgrade --old-bindir=/usr/bin/ --new-bindir=/usr/pgsql-10/bin/ --old-datadir=/var/lib/pgsql/data/ --new-datadir=/var/lib/pgsql/10/data/ --check
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok

*failure*
Consult the last few lines of "pg_upgrade_server.log" for
the probable cause of the failure.

connection to database failed: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/lib/pgsql/.s.PGSQL.50432"?

could not connect to source postmaster started with the command:
"/usr/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data/" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'" start
Failure, exiting


tail /var/lib/pgsql/pg_upgrade_server.log gives me:

server stopped
command: "/usr/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data/" -o "-p 50432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'" start &gt;&gt; "pg_upgrade_server.log" 2&gt;&amp;1
waiting for server to start....
FATAL: unrecognized configuration parameter "unix_socket_directory"
stopped waiting
pg_ctl: could not start server
Examine the log output.


How can I resolve this?
pg_ctl must call the wrong postgres binary.

PostgreSQL version 9.2 had a parameter unix_socket_directory, which does no longer exist (there is unix_socket_directories now). So a 9.2 server would never die with this message.

Are your PostgreSQL 9.2 binaries really installed in /usr/bin or is the pg_ctl there just a symbolic link or a script?

Try to find the directory where the postgres executable from the 9.2 installation is located and use that directory with the --old-bindir of pg_upgrade.