読者です 読者をやめる 読者になる 読者になる

kopug memo

名古屋で働くとあるWebエンジニアの覚書。

PostgreSQL8.1.4 と PgAdmin3 を Linuxにインストール

PgAdmin3 に必要なパッケージを入手する

http://www.postgresql.org/ftp/pgadmin3/release/v1.4.3/rhel-4/rpms/
上記のRPMを全てダウンロードする。

$ cd ~/tmp/pgadmin
$ ll
合計 29640
 -rw-rw-r--  1 masa masa  4727723  8月 26 14:25 pgadmin3-1.4.3-1.i686.rpm
 -rw-rw-r--  1 masa masa   110141  8月 26 14:26 pgadmin3-debuginfo-1.4.3-1.i686.rpm
 -rw-rw-r--  1 masa masa  2611153  8月 26 14:26 pgadmin3-docs-1.4.3-1.i686.rpm
 -rw-rw-r--  1 masa masa  3540522  8月 26 14:26 wxGTK-2.6.3-2.6.3.2.1.i686.rpm
 -rw-rw-r--  1 masa masa 18382274  8月 26 14:26 wxGTK-debuginfo-2.6.3-2.6.3.2.1.i686.rpm
 -rw-rw-r--  1 masa masa   885816  8月 26 14:26 wxGTK-devel-2.6.3-2.6.3.2.1.i686.rpm
 -rw-rw-r--  1 masa masa    27589  8月 26 14:26 wxGTK-gl-2.6.3-2.6.3.2.1.i686.rpm

このままインストールを試みると下記のエラーが出る。

$ sudo rpm -ivh *.rpm
エラー: Failed dependencies:
        libpq.so.3 is needed by pgadmin3-1.4.3-1.i686
        postgresql is needed by pgadmin3-1.4.3-1.i686
        gtk2-devel is needed by wxGTK-devel-2.6.3-2.6.3.2.1.i686
    Suggested resolutions:
        /home/buildcentos/CENTOS/en/4.0/i386/CentOS/RPMS/gtk2-devel-2.4.13-18.i3 86.rpm
        /home/buildcentos/CENTOS/en/4.0/i386/CentOS/RPMS/postgresql-7.4.8-1.RHEL 4.1.i386.rpm
        /home/buildcentos/CENTOS/en/4.0/i386/CentOS/RPMS/postgresql-libs-7.4.8-1 .RHEL4.1.i386.rpm

てことでやっぱまずは PostgreSQL を先にインストールしようかと思ったのですが、
良く見ると libpq.so.3 を必要らしい。これは postgresqlの7シリーズのライブラリなのだが、
今回はPostgreSQL8.1.4を入れたいので、このままでは利用できない。

仕方がないので、libpq.so.3を必要とするパッケージはこれ以外にもあるので、
postgresql-libs-7.4.13-1PGDG.i686.rpmpostgresql.orgよりダウンロードしてインストールをする。

$ sudo rpm -ivh postgresql-libs-7.4.13-1PGDG.i686.rpm

その後 PostgreSQL8をインストールするのに必要なパッケージをダウンロードしてきて、インストールをする。

$ ll

合計 10512
 -rw-rw-r--  1 masa masa 3329353  8月 26 14:31 postgresql-8.1.4-3PGDG.i686.rpm
 -rw-rw-r--  1 masa masa  395919  8月 26 14:31 postgresql-libs-8.1.4-3PGDG.i686.rpm
 -rw-rw-r--  1 masa masa 7015835  8月 26 14:31 postgresql-server-8.1.4-3PGDG.i686.rpm

$ sudo rpm -ivh *.rpm

Preparing...                ########################################### [100%]
   1:postgresql-libs        ########################################### [ 33%]
   2:postgresql             ########################################### [ 67%]
   3:postgresql-server      ########################################### [100%]

あとはgtk2-develだけになったので、これはyum経由でインストールしておく

$ sudo yum install gtk2-devel

Loading "fastestmirror" plugin
Setting up Install Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
    • > Populating transaction set with selected packages. Please wait.
      • > Downloading header for gtk2-devel to pack into transaction set.
gtk2-devel-2.4.13-18.i386 100% |=========================| 138 kB 00:00
      • > Package gtk2-devel.i386 0:2.4.13-18 set to be updated
    • > Running transaction check
    • > Processing Dependency: XFree86-devel for package: gtk2-devel
    • > Processing Dependency: pango-devel >= 1.4.0-1 for package: gtk2-devel
    • > Processing Dependency: atk-devel >= 1.6.0-1 for package: gtk2-devel
    • > Restarting Dependency Resolution with new changes.
    • > Populating transaction set with selected packages. Please wait.
      • > Downloading header for pango-devel to pack into transaction set.
pango-devel-1.6.0-9.i386. 100% |=========================| 19 kB 00:00
      • > Package pango-devel.i386 0:1.6.0-9 set to be updated
      • > Downloading header for xorg-x11-devel to pack into transaction set.
xorg-x11-devel-6.8.2-1.EL 100% |=========================| 500 kB 00:00
      • > Package xorg-x11-devel.i386 0:6.8.2-1.EL.13.37 set to be updated
      • > Downloading header for atk-devel to pack into transaction set.
atk-devel-1.8.0-2.i386.rp 100% |=========================| 12 kB 00:00
      • > Package atk-devel.i386 0:1.8.0-2 set to be updated
    • > Running transaction check
    • > Processing Dependency: fontconfig-devel >= 2.1 for package: xorg-x11-devel
    • > Processing Dependency: fontconfig-devel >= 2.0 for package: pango-devel
    • > Processing Dependency: freetype-devel >= 2.1.3-3 for package: pango-devel
    • > Restarting Dependency Resolution with new changes.
    • > Populating transaction set with selected packages. Please wait.
      • > Downloading header for fontconfig-devel to pack into transaction set.
fontconfig-devel-2.2.3-7. 100% |=========================| 36 kB 00:00
      • > Package fontconfig-devel.i386 0:2.2.3-7.centos4 set to be updated
      • > Downloading header for freetype-devel to pack into transaction set.
freetype-devel-2.1.9-4.el 100% |=========================| 23 kB 00:00
      • > Package freetype-devel.i386 0:2.1.9-4.el4 set to be updated
    • > Running transaction check
Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: gtk2-devel i386 2.4.13-18 base 2.1 M Installing for dependencies: atk-devel i386 1.8.0-2 base 86 k fontconfig-devel i386 2.2.3-7.centos4 update 232 k freetype-devel i386 2.1.9-4.el4 update 533 k pango-devel i386 1.6.0-9 base 173 k xorg-x11-devel i386 6.8.2-1.EL.13.37 update 5.1 M Transaction Summary ============================================================================= Install 6 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 8.2 M Is this ok [y/N]: y Downloading Packages: (1/6): fontconfig-devel-2 100% |=========================| 232 kB 00:00 (2/6): gtk2-devel-2.4.13- 100% |=========================| 2.1 MB 00:00 (3/6): freetype-devel-2.1 100% |=========================| 533 kB 00:00 (4/6): pango-devel-1.6.0- 100% |=========================| 173 kB 00:00 (5/6): xorg-x11-devel-6.8 100% |=========================| 5.1 MB 00:02 (6/6): atk-devel-1.8.0-2. 100% |=========================| 86 kB 00:00 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: freetype-devel ######################### [1/6] Installing: fontconfig-devel ######################### [2/6] Installing: xorg-x11-devel ######################### [3/6] Installing: pango-devel ######################### [4/6] Installing: atk-devel ######################### [5/6] Installing: gtk2-devel ######################### [6/6] Installed: gtk2-devel.i386 0:2.4.13-18 Dependency Installed: atk-devel.i386 0:1.8.0-2 fontconfig-devel.i386 0:2.2.3-7.centos4 freetype-devel.i386 0:2.1.9-4.el4 pango-devel.i386 0:1.6.0-9 xorg-x11-devel.i386 0:6.8.2-1.EL.13.37 Complete!

これで必要な依存パッケージは全て入れ終ったので、再度 PgAdmin3 をインストールする。

$ sudo rpm -ivh *.rpm
Preparing...                ########################################### [100%]
   1:wxGTK                  ########################################### [ 14%]
   2:pgadmin3               ########################################### [ 29%]
   3:wxGTK-gl               ########################################### [ 43%]
   4:pgadmin3-debuginfo     ########################################### [ 57%]
   5:pgadmin3-docs          ########################################### [ 71%]
   6:wxGTK-debuginfo        ########################################### [ 86%]
   7:wxGTK-devel            ########################################### [100%]

こんな感じで PostgreSQL と PgAdmin3のインストールは終了。
あとはお決まりのパターンを実行しておく

 $ sudo chkconfig postgresql on
 $ sudo service postgresql start