Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

4.7. Software Collections および scl-utils

Software Collections を使うと、システム上で複数バージョンの同一 RPM パッケージをビルドして、同時にインストールすることが可能になります。Software Collections は、従来の RPM パッケージマネジャーがインストールするパッケージのシステムバージョンに影響を与えません。
システム上で Software Collections のサポートを有効にするには、シェルプロンプトで root として以下を入力して scl-utils パッケージをインストールします。
~]# yum install scl-utils
scl-utils パッケージは scl ツールを提供します。これは Software Collection を有効にし、Software Collection 環境でアプリケーションを実行します。
scl ツールの一般的な使用方法は、以下の構文の使用で説明できます。
 scl action software_collection_1 software_collection_2 command 

例4.1 アプリケーションの直接実行する

software_collection_1 と呼ばれる Software Collection --version オプションで Perl を直接実行するには、以下のコマンドを実行します。
 scl enable software_collection_1 'perl --version' 

例4.2 複数の Software Collection を有効にして、シェルを実行する

複数の Software Collection を有効にした環境で Bash シェルを実行するには、以下のコマンドを実行します。
 scl enable software_collection_1 software_collection_2 bash 
上記のコマンドは、software_collection_1 および software_collection_2 と呼ばれる 2 つの Software Collection を有効にします。

例4.3 ファイルに保存されたコマンドを実行する

ファイルに保存された多くのコマンドを Software Collection 環境で実行するには、以下のコマンドを実行します。
 cat cmd | scl enable software_collection_1 - 
上記のコマンドは、software_collection_1 と呼ばれる Software Collection 環境の cmd ファイルに保存されているコマンドを実行します。
Software Collections および scl-utils に関する詳細情報は、Red Hat Software Collections 1.2 Beta Packaging Guide を参照してください。