カテゴリー
Linux

yum が便利になる RPMforge、Remi、EPEL とは一体何なのか

RPMforge、Remi、EPEL は yum のリポジトリというもののようです。yum によるパッケージの簡単インストール・アップデート・アンインストールをさらに便利にします。今回は、yum とそのリポジトリについて、自分なりに整理します。

まとめ

yum でインストールした追加リポジトリを有効にするためには、–enablerepo オプションを付ける。

# EPEL、Remi、RPMforgeリポジトリの中で最新のhtopパッケージの紹介を、アップデート情報とともに表示する。
yum --enablerepo=epel,remi,rpmforge info htop

yum のリポジトリ追加によるメリット・デメリット

リポジトリ追加によるメリットは次の点を抑えておけばよさそうです。

  • パッケージの種類が増える
  • バージョンが増える(最新版がインストールできるようになる)
  • ダウンロード元が増える

デメリットも考えます。リポジトリはRPMforge、Remi、EPEL 以外にもたくさんあるようです。ということは、入れすぎると管理が大変になってしまうのではないでしょうか?

具体的には、リポジトリをたくさん入れて、なおかつ全部有効にすると、何かのパッケージをインストールしようとするときにどのリポジトリのどのバージョンが選択されるかわからなくなってしまう、そのような困難が発生すると予想します。

また、最新のパッケージが入手できるということは、発見されていないセキュリティホールが残っていたりと信頼性にも疑問符がつくのでしょう。

yum のリポジトリ管理方法を考えます

その一。リポジトリの優先順位をつけるパッケージがある!yum-plugin-priorities というそうです。たぶん便利なのでしょう。しかし、yum のリポジトリはタイトルにあげた3つしか知りません。Linux もまだまだ初心者です。このパッケージのときはこのリポジトリ優先で、なんて判断できません。一応、本家サイトのリンクを残しておきます。

面倒ですっ!ですので次のを採用しますっっ

その二。基本はCentOS に最初から入っているリポジトリを使って、必要なときだけ追加したリポジトリを使います。次のページがとても参考になりました。リポジトリの設定だけでなく、インストール時に指定するオプションも載っていて実用的です。

yum のリポジトリを設定します。

※設定の仕方の部分だけまとめました。こちらの方がゼロからの手順ということもありすっきりしていると思います。→yum に RPMforge、Remi、EPEL リポジトリを導入してあえて無効にする手順!・・・リポジトリ再び♪ | oki2a24

早速やっていきます。中途半端にリポジトリを入れたり有効にしたりしているので、その修正作業となります。まずは、すでに終わっていますが、導入の方法をおさらいします。CentOSにPHP最新版をインストールしようと思ったら一筋縄ではいきませんでした | oki2a24のRemi、EPEL !?の部分で行ったことを抜粋します。

リポジトリをダウンロードし、インストールし、確認します。

Remi、EPEL リポジトリをダウンロードし、インストールします。ファイルがない場合は次の URL からファイルを探してダウンロードしなければならないようです。

  • http://download.fedora.redhat.com/pub/epel/5/x86_64/
    からepel-release-で始まるファイルを探してダウンロード
  • http://rpms.famillecollet.com/el5.x86_64/
    からremi-release-で始まるファイルを探してダウンロード
  • http://dag.wieers.com/rpm/packages/rpmforge-release/
    からrpmforge-release-で始まるファイルを探してダウンロード
[root@vps ~]# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
[root@vps ~]# wget http://rpms.famillecollet.com/el5.i386/remi-release-5-8.el5.remi.noarch.rpm
[root@vps ~]# rpm -Uvh remi-release-5-8.el5.remi.noarch.rpm epel-release-5-4.noarch.rpm

そして Remi の設定ファイルの5行目に1を設定し、有効化したところまで作業したのでした。一応、RPMforge も含めインストールされていることを確認します。

[root@vps ~]# rpm -qa | grep epel-release
epel-release-5-4
[root@vps ~]# rpm -qa | grep remi-release
remi-release-5-8.el5.remi
[root@vps ~]# rpm -qa | grep rpmforge-release
rpmforge-release-0.5.2-2.el5.rf

リポジトリを無効にします。

さて振り返ったところで、ここから目標に向けて設定をします。RPMforge、追加したRemi、EPEL リポジトリを無効にします。そうすれば明示的に指定したときのみ有効となります。

まずは有効化してしまった Remi を無効化状態に戻します。

[root@vps ~]# vim /etc/yum.repos.d/remi.repo
enabled=1

enabled=0

次に EPEL を無効化します。

vim /etc/yum.repos.d/epel.repo
enabled=1

enabled=0

最後に RPMforge を無効化します。

vim /etc/yum.repos.d/rpmforge.repo
enabled=1

enabled=0

実際に使い方を学習します。追加リポジトリを指定するとき、しないときで比べます。

リポジトリを実際に有効にしてみるやり方と、比較

利用できるパッケージやそのバージョンなどを調べたいとき、それぞれのリポジトリでどんなバージョンがダウンロードできるか判断できたら便利です。同じこと皆様も思いますよね?やってみましょう。簡単です。yum オプションに –enablerepo=epel,remi,rpmforge を付けるだけです。試すパッケージは、何にしましょう? top の上位版 htop にしましょう!使ってみたかったですし!今のうちにちょっとだけ調べちゃいましょう!わくわく!

追加リポジトリなしの場合

つまりオプションを設定しない場合ということになります。そんなパッケージないよ!といわれました。

[root@vps ~]# yum info htop
Loaded plugins: fastestmirror
Repository 'vz-base' is missing name in configuration, using id
Repository 'vz-updates' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Error: No matching Packages to list

EPEL の場合

ver 0.8.3 の htop が利用できるよ!ライセンスは GPL+ だよ!パッケージ説明は「htop is an interactive text-mode process viewer for Linux, similar to top(1).」だよ!といわれました。

[root@oki2a24 ~]# yum --enablerepo=epel info htop
Loaded plugins: fastestmirror
Repository 'vz-base' is missing name in configuration, using id
Repository 'vz-updates' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Available Packages
Name       : htop
Arch       : i386
Version    : 0.8.3
Release    : 1.el5
Size       : 67 k
Repo       : epel
Summary    : Interactive process viewer
URL        : http://htop.sourceforge.net/
License    : GPL+
Description: htop is an interactive text-mode process viewer for Linux, similar to
           : top(1).

Remi の場合

そんなパッケージないよ!といわれました。

[root@oki2a24 ~]# yum --enablerepo=remi info htop
Loaded plugins: fastestmirror
Repository 'vz-base' is missing name in configuration, using id
Repository 'vz-updates' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * remi: remi-mirror.dedipower.com
 * updates: ftp.iij.ad.jp
Error: No matching Packages to list

RPMforge の場合

ver 1.0.1 の htop が利用できるよ!ライセンスは GPL だよ!パッケージ説明は「htop is an interactive process viewer for Linux.」だよ!といわれました。

[root@vps ~]# yum --enablerepo=rpmforge info htop
Loaded plugins: fastestmirror
Repository 'vz-base' is missing name in configuration, using id
Repository 'vz-updates' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: ftp.iij.ad.jp
Available Packages
Name       : htop
Arch       : i386
Version    : 1.0.1
Release    : 1.el5.rf
Size       : 84 k
Repo       : rpmforge
Summary    : Interactive process viewer
URL        : http://htop.sourceforge.net/
License    : GPL
Description: htop is an interactive process viewer for Linux.

最後に、EPEL、Remi、RPMforge 全部指定の場合

最もバージョンの高い RPMforge のパッケージが選択されました。

[root@vps ~]# yum --enablerepo=remi,epel,rpmforge info htop
Loaded plugins: fastestmirror
Repository 'vz-base' is missing name in configuration, using id
Repository 'vz-updates' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * remi: remi-mirror.dedipower.com
 * rpmforge: fr2.rpmfind.net
 * updates: ftp.iij.ad.jp
remi                                                                                                                           | 2.5 kB     00:00
Available Packages
Name       : htop
Arch       : i386
Version    : 1.0.1
Release    : 1.el5.rf
Size       : 84 k
Repo       : rpmforge
Summary    : Interactive process viewer
URL        : http://htop.sourceforge.net/
License    : GPL
Description: htop is an interactive process viewer for Linux.

以上です。頭の中がかなりすっきりしました!

参考

今回タイトルにもあげたそれぞれの本家サイト

「yum が便利になる RPMforge、Remi、EPEL とは一体何なのか」への7件の返信

コメントありがとうございます。ご参考にされたあなたの投稿を拝見しました。

わたくしの思いついた検証方法を取り入れられて、
しっかりご自身のものにされて、オリジナルの投稿を作られた!
と感じました。
わたくしも嬉しく思います。また、わたくしこそお礼申し上げます。
ありがとうございます。