使用非官方源安装最新的Postgresql


要在新版本下实验一些新的功能,但官方或常用的apt/yum源里没有最新的安装版本,自己又不想动手编译,于是寻找到一些能提供最新版本的安装源,下面是具体操作方法。
Debian
使用PGDG
PGDG(PostgreSQL全球开发组) 维护着一个Postgres的Debican仓库。
http://apt.postgresql.org/pub/repos/apt/
当前支持 Debian squeeze wheezy sid
内容包括 postgres 8.3, 8.4 9.0,9.1,9.2
pgadmin3,pgpool-II
加入backports源(repo)
deb http://backports.debian.org/debian-backports squeeze-backports main
添加KEY
wget -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
新建'/etc/apt/sources.list.d/pgdg.list'文件,其内容为:
deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main
创建包更新的规则
/etc/apt/preferences.d/pgdg.pref
Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 500
更新源
apt-get update
apt-get install pgdg-keyring
开始安装
apt-get install postgresql-9.2 postgresql-contrib-9.2
当然也可将其加入到正式的源文件中:
(postgresql official repo)
deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main
参考链接:https://wiki.postgresql.org/wiki/Apt
CentOS
可以参考:http://yum.postgresql.org/
其设置与Debian类似。
以目前的9.2版本来说:
32-bit
# rpm -Uvh http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
64-bit
# rpm -Uvh http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
修改'CentOS-Base.repo'源文件
# vim /etc/yum.repos.d/CentOS-Base.repo
Append the exclude directive after the main and update definition
[base]
exclude=postgresql*
[updates]
exclude=postgresql*
这样在将其安装好后需要将其hold住,就不能在通过其它方式对它进行相关联的更新了。
Debian
使用PGDG
PGDG(PostgreSQL全球开发组) 维护着一个Postgres的Debican仓库。
http://apt.postgresql.org/pub/repos/apt/
当前支持 Debian squeeze wheezy sid
内容包括 postgres 8.3, 8.4 9.0,9.1,9.2
pgadmin3,pgpool-II
加入backports源(repo)
deb http://backports.debian.org/debian-backports squeeze-backports main
添加KEY
wget -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
新建'/etc/apt/sources.list.d/pgdg.list'文件,其内容为:
deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main
创建包更新的规则
/etc/apt/preferences.d/pgdg.pref
Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 500
更新源
apt-get update
apt-get install pgdg-keyring
开始安装
apt-get install postgresql-9.2 postgresql-contrib-9.2
当然也可将其加入到正式的源文件中:
(postgresql official repo)
deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main
参考链接:https://wiki.postgresql.org/wiki/Apt
CentOS
可以参考:http://yum.postgresql.org/
其设置与Debian类似。
以目前的9.2版本来说:
32-bit
# rpm -Uvh http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
64-bit
# rpm -Uvh http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
修改'CentOS-Base.repo'源文件
# vim /etc/yum.repos.d/CentOS-Base.repo
Append the exclude directive after the main and update definition
[base]
exclude=postgresql*
[updates]
exclude=postgresql*
这样在将其安装好后需要将其hold住,就不能在通过其它方式对它进行相关联的更新了。