how to install pgbench?

Solution 1:

Your mistake in:

sudo apt-get install postgresql91-contrib

It should be:

sudo apt-get install postgresql-contrib-9.1

Or just run:

sudo apt-get install postgresql-contrib

And after that you can run:

sudo ln -s /usr/share/postgresql-common/pg_wrapper /usr/bin/pgbench