さくらのVPSでEPELのパッケージを使用できるようにして、nginxをyumからインストールする方法

さくらのVPSの初期設定(CentOS5.5)では、nginxをyumでインストールできません。

今回は、Redhadの拡張パッケージであるEPELを使用できるようにして、nginxをyumでインストールできるようにします。

EPELのインストール

CentOS5.4のRPMパッケージを参照できるようにします。

# rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Retrieving http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

nginxのインストール

EPELがあればnginxをインストールできるようになります。

# yum -y install nginx
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * addons: ftp.nara.wide.ad.jp
 * base: ftp.nara.wide.ad.jp
 * epel: ftp.kddilabs.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
epel                                                     | 3.7 kB     00:00
epel/primary_db                                          | 3.4 MB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:0.8.53-1.el5 set to be updated
--> Processing Dependency: libgd.so.2()(64bit) for package: nginx
--> Processing Dependency: libGeoIP.so.1()(64bit) for package: nginx
--> Running transaction check
---> Package GeoIP.x86_64 0:1.4.7-0.1.20090931cvs.el5 set to be updated
---> Package gd.x86_64 0:2.0.33-9.4.el5_4.2 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch          Version                           Repository   Size
================================================================================
Installing:
 nginx        x86_64        0.8.53-1.el5                      epel        389 k
Installing for dependencies:
 GeoIP        x86_64        1.4.7-0.1.20090931cvs.el5         epel        710 k
 gd           x86_64        2.0.33-9.4.el5_4.2                base        155 k

Transaction Summary
================================================================================
Install       3 Package(s)
Upgrade       0 Package(s)

Total download size: 1.2 M
Downloading Packages:
(1/3): gd-2.0.33-9.4.el5_4.2.x86_64.rpm                  | 155 kB     00:00
(2/3): nginx-0.8.53-1.el5.x86_64.rpm                     | 389 kB     00:00
(3/3): GeoIP-1.4.7-0.1.20090931cvs.el5.x86_64.rpm        | 710 kB     00:00
--------------------------------------------------------------------------------
Total                                           2.6 MB/s | 1.2 MB     00:00
epel/gpgkey                                              | 1.7 kB     00:00

Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : GeoIP                                                    1/3
  Installing     : gd                                                       2/3
  Installing     : nginx                                                    3/3

Installed:
  nginx.x86_64 0:0.8.53-1.el5

Dependency Installed:
  GeoIP.x86_64 0:1.4.7-0.1.20090931cvs.el5    gd.x86_64 0:2.0.33-9.4.el5_4.2

Complete!


インストールできました。