(1) 从http://yum.pgrpms.org/repopackages.php 下载postgresql9.1 rpm安装包
[root@server1 ~]# wget http://yum.pgrpms.org/9.1/redhat/rhel-5-i386/pgdg-centos91-9.1-4.noarch.rpm
(2)安装pgdg-centos91-9.1-4.noarch.rpm
[root@server1 ~]# rpm -i pgdg-centos91-9.1-4.noarch.rpm
(3)更改CentOS-Base.repo
为方便通过yum安装postgresql9.1的相关软件,所以需要更改CentOS-Base.repo,以便于yum list postgresql* 能找到postgresql9.1的相关软件包
只需要在 CentOS-Base.repo的[base] and [updates]中增加'exclude=postgresql*'即可
具体操作如下:
[root@server1 ~]# cd /etc/yum.repos.d
[root@server1 yum.repos.d]# vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/ release=$releasever&arch=$basearch&repo=os
#baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
exclude=postgresql*
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/ release=$releasever&arch=$basearch&repo=updates
#baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
exclude=postgfesql*
#packages used/produced in the build but not released
(4)通过yum list postgres*来检测相关的安装包
Available Packages
postgresql91.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-contrib.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-debuginfo.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-devel.i686 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-devel.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-docs.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-jdbc.x86_64 9.1.901-1PGDG.rhel6 pgdg91
postgresql91-jdbc-debuginfo.x86_64 9.1.901-1PGDG.rhel6 pgdg91
postgresql91-libs.i686 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-libs.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-odbc.x86_64 09.00.0200-1PGDG.rhel6 pgdg91
postgresql91-odbc-debuginfo.x86_64 09.00.0200-1PGDG.rhel6 pgdg91
postgresql91-plperl.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-plpython.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-pltcl.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-python.x86_64 4.0-2PGDG.rhel6 pgdg91
postgresql91-python-debuginfo.x86_64 4.0-2PGDG.rhel6 pgdg91
postgresql91-server.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql91-tcl.x86_64 1.9.0-1.rhel6 pgdg91
postgresql91-tcl-debuginfo.x86_64 1.9.0-1.rhel6 pgdg91
postgresql91-test.x86_64 9.1.1-1PGDG.rhel6 pgdg91
postgresql_autodoc.noarch 1.40-1.rhel6 pgdg91
[root@server1 yum.repos.d]#
(6)使用yum安装postgresql9.1以及相关软件包
[ro