To install pgbench on Linux use yum and install the postgresql-contrib package using the below syntax.
- yum install postgresql-contrib
When issuing the above command the results will output like the below. If postgresql, postgresql-server, and/or postgresql-libs has already been installed then it is likely that they will be upgraded using the default command.
- [root@server ~]# yum install postgresql-contrib
- Loading "installonlyn" plugin
- Setting up Install Process
- Setting up repositories
- Reading repository metadata in from local files
- Parsing package install arguments
- Resolving Dependencies
- --> Populating transaction set with selected packages. Please wait.
- ---> Downloading header for postgresql-contrib to pack into transaction set.
- postgresql-contrib-8.3.5- 100% |=========================| 32 kB 00:00
- ---> Package postgresql-contrib.x86_64 0:8.3.5-2PGDG.rhel5 set to be updated
- --> Running transaction check
- --> Processing Dependency: postgresql = 8.3.5 for package: postgresql-contrib
- --> Processing Dependency: libossp-uuid.so.15()(64bit) for package: postgresql-contrib
- --> Restarting Dependency Resolution with new changes.
- --> Populating transaction set with selected packages. Please wait.
- ---> Downloading header for postgresql to pack into transaction set.
- postgresql-8.3.5-2PGDG.rh 100% |=========================| 43 kB 00:00
- ---> Package postgresql.x86_64 0:8.3.5-2PGDG.rhel5 set to be updated
- ---> Downloading header for uuid to pack into transaction set.
- uuid-1.5.1-4.rhel5.x86_64 100% |=========================| 4.8 kB 00:00
- ---> Package uuid.x86_64 0:1.5.1-4.rhel5 set to be updated
- --> Running transaction check
- --> Processing Dependency: postgresql = 8.3.3-1PGDG.rhel5 for package: postgresql-server
- --> Processing Dependency: postgresql-libs = 8.3.5-2PGDG.rhel5 for package: postgresql
- --> Restarting Dependency Resolution with new changes.
- --> Populating transaction set with selected packages. Please wait.
- ---> Downloading header for postgresql-server to pack into transaction set.
- postgresql-server-8.3.5-2 100% |=========================| 34 kB 00:00
- ---> Package postgresql-server.x86_64 0:8.3.5-2PGDG.rhel5 set to be updated
- ---> Downloading header for postgresql-libs to pack into transaction set.
- postgresql-libs-8.3.5-2PG 100% |=========================| 12 kB 00:00
- ---> Package postgresql-libs.x86_64 0:8.3.5-2PGDG.rhel5 set to be updated
- --> Running transaction check
- Dependencies Resolved
- =============================================================================
- Package Arch Version Repository Size
- =============================================================================
- Installing:
- postgresql-contrib x86_64 8.3.5-2PGDG.rhel5 pgdg83 403 k
- Installing for dependencies:
- uuid x86_64 1.5.1-4.rhel5 pgdg83 52 k
- Updating for dependencies:
- postgresql x86_64 8.3.5-2PGDG.rhel5 pgdg83 1.8 M
- postgresql-libs x86_64 8.3.5-2PGDG.rhel5 pgdg83 203 k
- postgresql-server x86_64 8.3.5-2PGDG.rhel5 pgdg83 4.7 M
- Transaction Summary
- =============================================================================
- Install 2 Package(s)
- Update 3 Package(s)
- Remove 0 Package(s)
- Total download size: 7.1 M
- Is this ok [y/N]: y
- Downloading Packages:
- (1/5): postgresql-server- 100% |=========================| 4.7 MB 00:04
- (2/5): postgresql-8.3.5-2 100% |=========================| 1.8 MB 00:01
- (3/5): postgresql-libs-8. 100% |=========================| 203 kB 00:00
- (4/5): uuid-1.5.1-4.rhel5 100% |=========================| 52 kB 00:00
- (5/5): postgresql-contrib 100% |=========================| 403 kB 00:00
- Running Transaction Test
- Finished Transaction Test
- Transaction Test Succeeded
- Running Transaction
- Updating : postgresql-libs ######################### [1/8]
- Updating : postgresql ######################### [2/8]
- Installing: uuid ######################### [3/8]
- Updating : postgresql-server ######################### [4/8]
- Installing: postgresql-contrib ######################### [5/8]
- Cleanup : postgresql-server ######################### [6/8]
- Cleanup : postgresql ######################### [7/8]
- Cleanup : postgresql-libs ######################### [8/8]
- Installed: postgresql-contrib.x86_64 0:8.3.5-2PGDG.rhel5
- Dependency Installed: uuid.x86_64 0:1.5.1-4.rhel5
- Dependency Updated: postgresql.x86_64 0:8.3.5-2PGDG.rhel5 postgresql-libs.x86_64 0:8.3.5-2PGDG.rhel5 postgresql-server.x86_64 0:8.3.5-2PGDG.rhel5
- Complete!