• [织梦吧]唯一域名:www.dedecms8.com,织梦DedeCMS学习平台.

当前位置: > 系统(os) > linux >

CentOS v6.3 安装PostgreSQL 9

来源: www.dedecms8.com 编辑:织梦吧 时间:2014-07-04点击:

1、下载并安装PostgreSQL官方软件仓库

  访问http://yum.pgrpms.org/repopackages.php,选择对应的操作系统版本,下载repo rpm文件。对应我的操作系统CentOS 6.3 32位版本,使用wget命令下载,操作如下:

[root@wardking ~]# wget http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm –2012-10-11 02:52:40– http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm Resolving yum.pgrpms.org… 98.129.198.114 Connecting to yum.pgrpms.org|98.129.198.114|:80… connected. HTTP request sent, awaiting response… 200 OK Length: 5328 (5.2K) [application/x-redhat-package-manager] Saving to: pgdg-centos92-9.2-6.noarch.rpm 100%[==============================================================================================================================>] 5,328 24.7K/s in 0.2s 2012-10-11 02:52:42 (24.7 KB/s) – “pgdg-centos92-9.2-6.noarch.rpmâ€

  安装软件仓库

[root@wardking ~]# rpm -ivh pgdg-centos92-9.2-6.noarch.rpm warning: pgdg-centos92-9.2-6.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing… ########################################### [100%] 1:pgdg-centos92 ########################################### [100%]

  编辑CentOS-Base.repo,将目前的CentOS仓库中的版本排除

[root@wardking ~]# vi /etc/yum.repos.d/CentOS-Base.repo # remarked out baseurl= line instead. [base] name=CentOS-$releasever – Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 exclude=postgresql* #released updates [updates] name=CentOS-$releasever – Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 exclude=postgresql*

  试一下,应该可以看到最新的PostgreSQL出现在可用软件列表中:

[root@wardking ~]# yum list postgres* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.btte.net * epel: mirrors.ustc.edu.cn * extras: mirrors.btte.net * rpmforge: mirror.fairway.ne.jp * updates: mirrors.btte.net base extras pgdg92 pgdg92/primary_db updates Installed Packages postgresql.i686 8.4.13-1.el6_3 postgresql-contrib.i686 8.4.13-1.el6_3 postgresql-devel.i686 8.4.13-1.el6_3 postgresql-libs.i686 8.4.13-1.el6_3 postgresql-plperl.i686 8.4.13-1.el6_3 postgresql-server.i686 8.4.13-1.el6_3 Available Packages postgresql-ip4r.i686 1.05-1.el6 postgresql-pgpool-II.i686 3.2.0-1.el6 postgresql-pgpool-II-devel.i686 3.2.0-1.el6 postgresql-pgpool-II-recovery.i686 3.2.0-1.el6 postgresql-plparrot.i686 0.04-5.el6 postgresql-plruby.i686 0.5.3-4.el6 postgresql-plruby-doc.i686 0.5.3-4.el6 postgresql-relay.i686 1.3-2.2.el6.rf postgresql92.i686 9.2.1-1PGDG.rhel6 postgresql92-contrib.i686 9.2.1-1PGDG.rhel6 postgresql92-debuginfo.i686 9.2.1-1PGDG.rhel6 postgresql92-devel.i686 9.2.1-1PGDG.rhel6 postgresql92-docs.i686 9.2.1-1PGDG.rhel6 postgresql92-jdbc.i686 9.2.1000-1PGDG.rhel6 postgresql92-jdbc-debuginfo.i686 9.2.1000-1PGDG.rhel6 postgresql92-libs.i686 9.2.1-1PGDG.rhel6 postgresql92-odbc.i686 09.01.0200-1PGDG.rhel6 postgresql92-odbc-debuginfo.i686 09.01.0200-1PGDG.rhel6 postgresql92-plperl.i686 9.2.1-1PGDG.rhel6 postgresql92-plpython.i686 9.2.1-1PGDG.rhel6 postgresql92-pltcl.i686 9.2.1-1PGDG.rhel6 postgresql92-server.i686 9.2.1-1PGDG.rhel6 postgresql92-tcl.i686 2.0.0-1.rhel6 postgresql92-tcl-debuginfo.i686 2.0.0-1.rhel6 postgresql92-test.i686 9.2.1-1PGDG.rhel6

 将旧版本中的postgresql软件包全部删除

[root@wardking ~]# yum remove postgresql postgresql-contrib postgresql-libs postgresql-devel postgresql-plperl postgr Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies –> Running transaction check —> Package postgresql.i686 0:8.4.13-1.el6_3 will be erased —> Package postgresql-contrib.i686 0:8.4.13-1.el6_3 will be erased —> Package postgresql-devel.i686 0:8.4.13-1.el6_3 will be erased —> Package postgresql-libs.i686 0:8.4.13-1.el6_3 will be erased –> Processing Dependency: libpq.so.5 for package: libdbi-dbd-pgsql-0.8.3-5.1.el6.i686 –> Processing Dependency: postgresql-libs for package: libdbi-dbd-pgsql-0.8.3-5.1.el6.i686 —> Package postgresql-plperl.i686 0:8.4.13-1.el6_3 will be erased —> Package postgresql-server.i686 0:8.4.13-1.el6_3 will be erased –> Running transaction check —> Package libdbi-dbd-pgsql.i686 0:0.8.3-5.1.el6 will be erased –> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================== Package Arch Version ====================================================================================================================== Removing: postgresql i686 8.4.13-1.el6_3 postgresql-contrib i686 8.4.13-1.el6_3 postgresql-devel i686 8.4.13-1.el6_3 postgresql-libs i686 8.4.13-1.el6_3 postgresql-plperl i686 8.4.13-1.el6_3 postgresql-server i686 8.4.13-1.el6_3 Removing for dependencies: libdbi-dbd-pgsql i686 0.8.3-5.1.el6 Transaction Summary ====================================================================================================================== Remove 7 Package(s) Installed size: 34 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Erasing : postgresql-devel-8.4.13-1.el6_3.i686 Erasing : postgresql-contrib-8.4.13-1.el6_3.i686 Erasing : postgresql-plperl-8.4.13-1.el6_3.i686 Erasing : postgresql-server-8.4.13-1.el6_3.i686 Erasing : postgresql-8.4.13-1.el6_3.i686 Erasing : libdbi-dbd-pgsql-0.8.3-5.1.el6.i686 Erasing : postgresql-libs-8.4.13-1.el6_3.i686 Verifying : postgresql-8.4.13-1.el6_3.i686 Verifying : postgresql-server-8.4.13-1.el6_3.i686 Verifying : postgresql-contrib-8.4.13-1.el6_3.i686 Verifying : libdbi-dbd-pgsql-0.8.3-5.1.el6.i686 Verifying : postgresql-devel-8.4.13-1.el6_3.i686 Verifying : postgresql-plperl-8.4.13-1.el6_3.i686 Verifying : postgresql-libs-8.4.13-1.el6_3.i686 Removed: postgresql.i686 0:8.4.13-1.el6_3 postgresql-contrib.i686 0:8.4.13-1.el6_3 postgresql-devel.i686 0:8.4.13- postgresql-plperl.i686 0:8.4.13-1.el6_3 postgresql-server.i686 0:8.4.13-1.el6_3 Dependency Removed: libdbi-dbd-pgsql.i686 0:0.8.3-5.1.el6 Complete!

猜您也喜欢...

猜你也喜欢看这些...

About D8

  • ©2014 织梦吧(d8) DedeCMS学习交流平台
  • 唯一网址 www.DedeCMS8.com 网站地图
  • 联系我们 1170734538@qq.com ,  QQ