49
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

Organization

CentOSにyumリポジトリを追加

概要

vagrant上のCentOSにphp5.4をインストールしたいが、リポジトリに存在しなかった。
→epelやremiリポジトリを追加して解決する。

インストール可能なパッケージリストを確認

php5.4がインストールしたい。
yum内にあるか確認。


[vagrant@localhost ~]$ yum --enablerepo=epel,remi,rpmforge info php
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: ftp.tsukuba.wide.ad.jp
 * extras: ftp.tsukuba.wide.ad.jp
 * updates: ftp.tsukuba.wide.ad.jp
base                                                                                                               | 3.7 kB     00:00
extras                                                                                                             | 3.4 kB     00:00
updates                                                                                                            | 3.4 kB     00:00
Available Packages
Name        : php
Arch        : x86_64
Version     : 5.3.3
Release     : 23.el6_4
Size        : 1.1 M
Repo        : updates
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP
Description : PHP is an HTML-embedded scripting language. PHP attempts to make it
            : easy for developers to write dynamically generated webpages. PHP also
            : offers built-in database integration for several commercial and
            : non-commercial database management systems, so writing a
            : database-enabled webpage with PHP is fairly simple. The most common
            : use of PHP coding is probably as a replacement for CGI scripts.
            :
            : The php package contains the module which adds support for the PHP
            : language to Apache HTTP Server.

5.3しかない。
RepoがCentOSデフォルト(updates)になっているので、とりあえずepel/remiリポジトリを追加する。

epel追加

[vagrant@localhost ~]$ wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
--2013-10-14 06:58:52--  http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
ftp.riken.jp をDNSに問いあわせています... 134.160.38.1
ftp.riken.jp|134.160.38.1|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 1649 (1.6K) [text/plain]
`RPM-GPG-KEY-EPEL-6' に保存中

100%[================================================================================================>] 1,649       --.-K/s 時間 0s

2013-10-14 06:58:57 (157 MB/s) - `RPM-GPG-KEY-EPEL-6' へ保存完了 [1649/1649]

[vagrant@localhost ~]$ sudo rpm --import RPM-GPG-KEY-EPEL-6
[vagrant@localhost ~]$ sudo touch /etc/yum.repos.d/epel.repo
[vagrant@localhost ~]$ sudo vi /etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel.repo
[epel]
name=EPEL RPM Repository for Red Hat Enterprise Linux
baseurl=http://ftp.riken.jp/Linux/fedora/epel/6/$basearch/
gpgcheck=1
enabled=0

remi

[vagrant@localhost ~]$ wget http://rpms.famillecollet.com/RPM-GPG-KEY-remi
--2013-10-14 06:59:44--  http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpms.famillecollet.com をDNSに問いあわせています... 195.154.241.117, 2a01:e0b:1000:18:be30:5bff:fed0:614
rpms.famillecollet.com|195.154.241.117|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 1340 (1.3K) [text/plain]
`RPM-GPG-KEY-remi' に保存中

100%[================================================================================================>] 1,340       --.-K/s 時間 0s

2013-10-14 06:59:49 (137 MB/s) - `RPM-GPG-KEY-remi' へ保存完了 [1340/1340]

[vagrant@localhost ~]$ sudo rpm --import RPM-GPG-KEY-remi
[vagrant@localhost ~]$ sudo vi /etc/yum.repos.d/remi.repo

/etc/yum.repos.d/remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux 5 - $basearch
baseurl=http://rpms.famillecollet.com/el5.$basearch/
http://iut-info.univ-reims.fr/remirpms/el5.$basearch/
enabled=0
priority=1

再びインストール可能なパッケージリストを確認

[vagrant@localhost ~]$ yum --enablerepo=epel,remi,rpmforge info php
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: www.ftp.ne.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
base                                                                                                               | 3.7 kB     00:00
epel                                                                                                               | 3.9 kB     00:00
epel/primary_db                                                                                                    | 5.6 MB     00:00
extras                                                                                                             | 3.4 kB     00:00
remi                                                                                                               | 2.5 kB     00:00
remi/primary_db                                                                                                    | 540 kB     00:02
updates                                                                                                            | 3.4 kB     00:00
Available Packages
Name        : php
Arch        : x86_64
Version     : 5.4.20
Release     : 1.el6.remi
Size        : 3.1 M
Repo        : remi
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP and Zend and BSD
Description : PHP is an HTML-embedded scripting language. PHP attempts to make it
            : easy for developers to write dynamically generated web pages. PHP also
            : offers built-in database integration for several commercial and
            : non-commercial database management systems, so writing a
            : database-enabled webpage with PHP is fairly simple. The most common
            : use of PHP coding is probably as a replacement for CGI scripts.
            :
            : The php package contains the module (often referred to as mod_php)
            : which adds support for the PHP language to Apache HTTP Server.

5.4が追加された(Repoはremi)。

参考

外部リポジトリの追加(remi,epel)
http://qiita.com/ryurock/items/662e41376efa97251575

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
49
Help us understand the problem. What are the problem?