#navi(../)
* PostgreSQLコミュニティーベースのリポジトリを設定し最新を利用する [#q0f78b72]
ディストリビューションが提供しているPostgreSQLのバージョンが古いな〜と思われている方、~
PostgreSQLコミュニティーベースのリポジトリの追加方法を以下に記します。~
本資料の動作確認はCentOS6で行いました。
#contents
#htmlinsertpcsp(db-top.html,db-sp.html)
*関連記事 [#e2516fdb]
-[[CentOSインストール&起動メモ>PostgreSQL/CentOSインストール]]
-[[PostgreSQLをソースからCentOSにインストール>PostgreSQL/PostgreSQLをソースからCentOSにインストール]]
* PostgreSQLのリポジトリ追加 [#y0e96e13]
以下のURLからリポジトリの情報を取得することができます。~
PostgreSQL RPM Building Project - Repository Packages~
http://yum.postgresql.org/repopackages.php
#br
本記事を書いている時点のPostgreSQLの最新バージョンをyumコマンドでインストールすることができます。
#ref(01.gif)
#br
上記のURLに接続し使用しているOSのバージョンに対応したPostgreSQLのRPMsをダウンロードします。~
今回はCentOS6のi386(32bit)を利用しているので CentOS6 - i386 をクリックしダウンロードしました。
&color(red){注意};&br;~
既にyumによりPostgreSQLをインストールしている場合は、以下のコマンドでアンインストールしてください。~
rpm -e postgresql-server postgresql
** ダウンロードしたファイルをインストール [#v7a8bf0c]
以下のURLからディストリビューションとCPUアーキテクチャーにあったリンクをクリックしてください。~
http://yum.postgresql.org/repopackages.php
今回使用した環境は(CentOS6 - i386)以下のrpmをブラウザを使ってダウンロードしました。~
http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
+ rootユーザにsuします。
+ ダウンロードしたrpmを以下のコマンドでインストールします。~
rpm -ivh ダウンロードしたファイル名
以下、上記手順を本資料の確認環境で操作した時の出力です。
[sakura@centos6 ~]$ su -
パスワード:
[root@centos6 ~]# rpm -ivh /tmp/pgdg-centos92-9.2-6.noarch.rpm
警告: /tmp/pgdg-centos92-9.2-6.noarch.rpm: ヘッダ V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
準備中... ########################################### [100%]
1:pgdg-centos92 ########################################### [100%]
[root@centos6 ~]#
yum search コマンドで postgresql92 で検索した結果です。
[root@centos6 ~]# yum search postgresql92
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.tsukuba.wide.ad.jp
* extras: ftp.tsukuba.wide.ad.jp
* updates: www.ftp.ne.jp
========================== N/S Matched: postgresql92 ===========================
postgresql92-debuginfo.i686 : Debug information for package postgresql92
postgresql92-jdbc-debuginfo.i686 : Debug information for package
: postgresql92-jdbc
postgresql92-odbc-debuginfo.i686 : Debug information for package
: postgresql92-odbc
postgresql92-tcl-debuginfo.i686 : Debug information for package postgresql92-tcl
postgresql92.i686 : PostgreSQL client programs and libraries
postgresql92-contrib.i686 : Contributed source and binaries distributed with
: PostgreSQL
postgresql92-devel.i686 : PostgreSQL development header files and libraries
postgresql92-docs.i686 : Extra documentation for PostgreSQL
postgresql92-jdbc.i686 : JDBC driver for PostgreSQL
postgresql92-libs.i686 : The shared libraries required for any PostgreSQL
: clients
postgresql92-odbc.i686 : PostgreSQL ODBC driver
postgresql92-plperl.i686 : The Perl procedural language for PostgreSQL
postgresql92-plpython.i686 : The Python procedural language for PostgreSQL
postgresql92-pltcl.i686 : The Tcl procedural language for PostgreSQL
postgresql92-server.i686 : The programs needed to create and run a PostgreSQL
: server
postgresql92-tcl.i686 : A Tcl client library for PostgreSQL
postgresql92-test.i686 : The test suite distributed with PostgreSQL
Name and summary matches only, use "search all" for everything.
* PostgreSQLのインストール [#mbf3c8bd]
上記でyumコマンドによる検索ができるようになったので、yum installを使用してPostgreSQLコミュニティーが提供しているrpmパッケージをインストールすることができるようになります。
以下のコマンドでPostgreSQL 9.2をインストールすることができました。
yum install postgresql92-server postgresql92
バージョンの確認
# psql --version
psql (PostgreSQL) 9.2.1
postgres本体などは、以下のディレクトリにインストールされていました。~
/usr/pgsql-9.2
また、chkconfigで確認すると以下のように登録されていました。
# chkconfig --list | grep postgres
postgresql-9.2 0:off 1:off 2:off 3:off 4:off 5:off 6:off
#htmlinsertpcsp(db-btm.html,db-sp.html)