centos 6.4下安装postgresql 9.2

时间:2023-03-09 18:00:08
centos 6.4下安装postgresql 9.2

我的linux版本是centos 6.4 ,准备安装postgresql 9.2

根据官方说明:

http://www.postgresql.org/download/linux/redhat/

缺省只能是8.4版本,如果要安装9.2,必须做一下改动:

rpm -i http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm

yum install postgresql92-server postgresql92-contrib
service postgresql-9.2 initdb
chkconfig postgresql-9.2 on

第一步:

[root@wcf ~]#  rpm -i http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm                                                         
warning: /var/tmp/rpm-tmp.sTOQTP: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY

第二步:

root@wcf ~]# yum install postgresql92-server postgresql92-contrib              
Loaded plugins: fastestmirror, refresh-packagekit, security                     
Loading mirror speeds from cached hostfile                                      
 * base: mirrors.163.com                                                        
 * extras: mirrors.163.com                                                      
 * updates: mirrors.163.com                                                     
pgdg92                                                   | 2.8 kB     00:00     
pgdg92/primary_db                                        | 106 kB     00:00     
Setting up Install Process                                                      
Resolving Dependencies
--> Running transaction check
---> Package postgresql92-contrib.x86_64 0:9.2.4-1PGDG.rhel6 will be installed
--> Processing Dependency: postgresql92 = 9.2.4 for package: postgresql92-contrib-9.2.4-1PGDG.rhel6.x86_64
--> Processing Dependency: libossp-uuid.so.16()(64bit) for package: postgresql92-contrib-9.2.4-1PGDG.rhel6.x86_64
---> Package postgresql92-server.x86_64 0:9.2.4-1PGDG.rhel6 will be installed
--> Running transaction check
---> Package postgresql92.x86_64 0:9.2.4-1PGDG.rhel6 will be installed
--> Processing Dependency: postgresql92-libs = 9.2.4-1PGDG.rhel6 for package: postgresql92-9.2.4-1PGDG.rhel6.x86_64
---> Package uuid.x86_64 0:1.6.1-10.el6 will be installed
--> Running transaction check
---> Package postgresql92-libs.x86_64 0:9.2.4-1PGDG.rhel6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                   Arch        Version                Repository   Size
================================================================================
Installing:
 postgresql92-contrib      x86_64      9.2.4-1PGDG.rhel6      pgdg92      435 k
 postgresql92-server       x86_64      9.2.4-1PGDG.rhel6      pgdg92      3.8 MDownloading Packages:
(1/5): postgresql92-9.2.4-1PGDG.rhel6.x86_64.rpm         | 970 kB     00:03
(2/5): postgresql92-contrib-9.2.4-1PGDG.rhel6.x86_64.rpm | 435 kB     00:00
(3/5): postgresql92-libs-9.2.4-1PGDG.rhel6.x86_64.rpm    | 185 kB     00:00
(4/5): postgresql92-server-9.2.4-1PGDG.rhel6.x86_64.rpm  | 3.8 MB     00:07
(5/5): uuid-1.6.1-10.el6.x86_64.rpm                      |  54 kB     00:00
--------------------------------------------------------------------------------
Total                                           409 kB/s | 5.4 MB     00:13
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : postgresql92-libs-9.2.4-1PGDG.rhel6.x86_64                   1/5
  Installing : postgresql92-9.2.4-1PGDG.rhel6.x86_64                        2/5
  Installing : uuid-1.6.1-10.el6.x86_64                                     3/5
  Installing : postgresql92-contrib-9.2.4-1PGDG.rhel6.x86_64                4/5
  Installing : postgresql92-server-9.2.4-1PGDG.rhel6.x86_64                 5/5
  Verifying  : postgresql92-libs-9.2.4-1PGDG.rhel6.x86_64                   1/5
  Verifying  : uuid-1.6.1-10.el6.x86_64                                     2/5
  Verifying  : postgresql92-server-9.2.4-1PGDG.rhel6.x86_64                 3/5
  Verifying  : postgresql92-contrib-9.2.4-1PGDG.rhel6.x86_64                4/5
  Verifying  : postgresql92-9.2.4-1PGDG.rhel6.x86_64                        5/5

Installed:
  postgresql92-contrib.x86_64 0:9.2.4-1PGDG.rhel6
  postgresql92-server.x86_64 0:9.2.4-1PGDG.rhel6

Dependency Installed:
  postgresql92.x86_64 0:9.2.4-1PGDG.rhel6
  postgresql92-libs.x86_64 0:9.2.4-1PGDG.rhel6
  uuid.x86_64 0:1.6.1-10.el6

Complete!

Installing for dependencies:
 postgresql92              x86_64      9.2.4-1PGDG.rhel6      pgdg92      970 k
 postgresql92-libs         x86_64      9.2.4-1PGDG.rhel6      pgdg92      185 k
 uuid                      x86_64      1.6.1-10.el6           base         54 k

Transaction Summary
================================================================================
Install       5 Package(s)

Total download size: 5.4 M
Installed size: 23 M
Is this ok [y/N]: y