Error 500 after updating 8.16.1 to 8.16.6

After the simple apt-get upgrade my GitLab updated from 8.16.1 to 8.16.6 and remain stucked on Error 500.

I see that givig a gitlab-ctl tail postgresql I have these errors:

2017-02-21_10:24:52.24276 LOG:  unrecognized configuration parameter "unix_socket_directories" in file "/var/opt/gitlab/postgresql/data/postgresql.conf" line 72
2017-02-21_10:24:52.24301 LOG:  unrecognized configuration parameter "min_wal_size" in file "/var/opt/gitlab/postgresql/data/postgresql.conf" line 177
2017-02-21_10:24:52.24308 LOG:  unrecognized configuration parameter "max_wal_size" in file "/var/opt/gitlab/postgresql/data/postgresql.conf" line 178
2017-02-21_10:24:52.24309 FATAL:  configuration file "/var/opt/gitlab/postgresql/data/postgresql.conf" contains errors

and this is a report of gitlab-ctl status

run: gitlab-workhorse: (pid 452) 2103s; run: log: (pid 450) 2103s
run: logrotate: (pid 445) 2103s; run: log: (pid 444) 2103s
run: nginx: (pid 446) 2103s; run: log: (pid 441) 2103s
down: postgresql: 0s, normally up, want up; run: log: (pid 453) 2103s
run: redis: (pid 451) 2103s; run: log: (pid 447) 2103s
run: sidekiq: (pid 5253) 126s; run: log: (pid 454) 2103s
run: unicorn: (pid 448) 2103s; run: log: (pid 443) 2103s

I think something happened with postgresql but don’t know what.
I tried to restore the backup but obv I have the version error

root@vps113842:/var/opt/gitlab/backups# sudo gitlab-rake gitlab:backup:restore BACKUP= 1487666486_2017_02_21
Unpacking backup ... done
GitLab version mismatch:
  Your current GitLab version (8.16.6) differs from the GitLab version in the backup!
  Please switch to the following version and try again:
  version: 8.16.1

Hint: git checkout v8.16.1

How can I troubleshoot this?

Hey,
Had the same issue, solved easily enough in my case with apt-get install --reinstall gitlab-ce, not sure how would you do a reinstall with a source package though.