CentOSで利用可能なYUMリポジトリについて
目次
Software Collections(SCLs)
- SCLs(Software Collections)はRHEL(CentOS) 上で最新のソフトウェアを利用するためのソフトウェアパッケージ集です。
- Ruby, Python, Perl, PHP, Node.js といった言語の比較的新しいバージョンをサポートするYUMリポジトリとなります。
- 他にも PostgreSQL, MySQL といったミドルウェアの提供もありますが、こちらは別途本家からのものを利用した方がいいと思います。
SCLsセットアップ
リポジトリ名 |
デフォルト |
GPGパス |
所属パッケージ |
centos-sclo-rh |
有効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo |
centos-release-scl-rh |
centos-sclo-rh-testing |
無効 |
署名無し |
centos-release-scl-rh |
centos-sclo-rh-source |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo |
centos-release-scl-rh |
centos-sclo-rh-debuginfo |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo |
centos-release-scl-rh |
centos-sclo-sclo |
有効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo |
centos-release-scl |
centos-sclo-sclo-testing |
無効 |
署名無し |
centos-release-scl |
centos-sclo-sclo-source |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo |
centos-release-scl |
centos-sclo-sclo-debuginfo |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo |
centos-release-scl |
- 通常の利用において、上記リポジトリが有効で問題無い。
- GDBでデバッグしたい向けは、debuginfo リポジトリを有効にして当該パッケージに該当するパッケージを追加インストールすること。
- ソースについては言うまでも無く。
CentOS7環境
未検証。たぶんCentOS6と同じ。
CentOS6環境
yum -y install centos-release-scl
CentOS5環境
未サポート。提供予定無し。
CentOS4環境
未サポート。提供予定無し。
SCLsインストール例
Perl 5.20
yum -y install rh-perl520
SCLs運用メモ
- 混ぜても大丈夫を実現するため、インストール先が特殊です。
- /opt/rh/パッケージ集名/root がインストールの起点(トップディレクトリ)となります。
- 例えば Perl 5.20 であるところの rh-perl520 の場合、「/opt/rh/rh-perl520/root」となります。
- よって PATH 等の調整の必要がありますが、他にも調整しないといけないものがあるので、「scl enable」コマンドを使用して実行します。
scl enable <パッケージ集名> [<パッケージ集名>...] "コマンド"
- 「パッケージ集名」を複数指定することが可能。その場合「パッケージ集名」分の PATH が追加したとイメージすると良いです。
- 「"コマンド"」はシェル的に単一引数となるように指定します(二個以上の指定はできない)。
- 例えば Perl 5.20 であるところの rh-perl520 の場合、下記のような感じで実行します。
$ scl enable rh-perl520 "perl -v" This is perl 5, version 20, subversion 1 (v5.20.1) built for x86_64-linux-thread-multi (with 16 registered patches, see perl -V for more detail) Copyright 1987-2014, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
- シェルスクリプト上での使用を前提に PATH に含めたい場合、以下のような設定を実施します(イディオム)。
: source /opt/rh/パッケージ集名/enable export X_SCLS="$(scl enable パッケージ集名 'echo $X_SCLS')" :
SCLs参考文献
Extra Packages for Enterprise Linux(EPEL)
- CentOSと共存共栄を前提に作られたYUMリポジトリです。
- CentOS標準では足りないパッケージを補ってくれます。
- その代わり、CentOS標準とは競合するパッケージ(最新のライブラリなど)のインストールは行われません。
- よってそれほど最新のパッケージが提供されているわけではありません。過度の期待は禁物です。
- なお yum update によりEPEL提供パッケージへ更新されるような事態は発生しません。
EPELセットアップ
リポジトリ名 |
デフォルト |
GPGパス |
所属パッケージ |
epel |
有効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL |
epel-release |
epel-debuginfo |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL |
epel-release |
epel-source |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL |
epel-release |
epel-testing |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL |
epel-release |
epel-testing-debuginfo |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL |
epel-release |
epel-testing-source |
無効 |
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL |
epel-release |
- 通常の利用において、上記リポジトリが有効で問題無い。
- GDBでデバッグしたい向けは、debuginfo リポジトリを有効にして当該パッケージに該当するパッケージを追加インストールすること。
- ソースについては言うまでも無く。
CentOS7環境
yum -y install epel-release
CentOS6環境
yum -y install epel-release
CentOS5環境
yum -y install epel-release
なおドキュメントによってはRPMでインストールする手段について解説されていることもありますが、その場合下記の通り指定します。
rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
dl.fedoraproject.org ではなく、download.fedoraproject.org を指定した場合、いつの頃からか、下記のようなメッセージでエラーがでるようになりました。
# rpm -Uvh http://download.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm Retrieving http://download.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm error: skipping http://download.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm - transfer failed - Unknown or unexpected error warning: u 0x6930b90 ctrl 0x6931f20 nrefs != 0 (download.fedoraproject.org http)
これは、Webサーバーからの応答が、RPMを返すのではなく、近くのミラーサイトにリダイレクトしていることが原因のためです。 この当時の rpm コマンドは、リダイレクト処理(ハンドリング)が行えなかったため、回避する必要がありました。 今時は yum install で入るので気にしない。
CentOS4環境
rpm -Uvh http://dl.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm ないしは rpm -Uvh http://dl.fedoraproject.org/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm
EPELインストール例
通常のCentOS標準パッケージと同じ扱いとなりますので、明示的にこれを入れるというパターンはありません。