TITLE:yumの設定 *yumの設定 [#i6ddd63e] **yum-prioritiesのインストール [#f8b94084] リポジトリの優先順位を設定できる、yum-prioritiesというプラグインをインストールする。 # yum -y install yum-plugin-priorities **centosplusの利用 [#zf2aa30d] ベースになるリポジトリ情報を編集する。 # vi /etc/yum.repos.d/CentOS-Base.repo 該当箇所を探して、「enabled=0」を「enabled=1」に変更 ... [centosplus] ... enabled=0 ← 1に変更 ... ... [contrib] ... enabled=0 ← 1に変更 ... さらに、各ベースのリポジトリの最後に優先順位を設定する。baseの場合は次の通り。 [base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 priority=1 ←優先順位の設定(contribの場合だけ2とかにしておく) プライオリティは1~99の値で設定する。値が大きい(または未設定)であるほど、優先順位は下がる。 **外部リポジトリ(EPEL)の利用 [#b6adc6b5] いくつかの外部リポジトリを利用することにする。 まずは、Fedoraプロジェクトが提供する[[EPEL(Extra Packages for Enterprise Linux):http://fedoraproject.org/wiki/EPEL/ja]]を導入。 # rpm --import http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 # rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 「--enablerepo」オプションなしで使うことがないように、次の2つのリポジトリの設定ファイルで「enabled=0」としておく。 -/etc/yum.repos.d/epel.repo -/etc/yum.repos.d/epel-testing.repo 使うときは、次のようにオプションを指定する。 # yum --enablerepo=epel <command> [<package> ...] **外部リポジトリ(RepoForge、元RPMForge)の利用 [#t936f548] 有名なサードパーティのリポジトリ、[[RepoForge:http://repoforge.org/]]も導入する。RepoForgeはRPMforgeから名称変更したリポジトリ。 # rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # rpm -ihv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm あと、いつも使うとは限らないので、リポジトリの設定ファイルでRepoForge(RPMforge)については「enabled=0」にしておく。 -/etc/yum.repos.d/rpmforge.repo 使うときは、次のようにオプションを指定する。 # yum --enablerepo=rpmforge <command> [<package> ...] **外部リポジトリ(Remi)の利用 [#t936f548] LAMP(LAMPP)の最新バージョンを揃えたリポジトリ、[[Remi:http://rpms.famillecollet.com/]]も導入する。 # rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi # rpm -ihv http://rpms.famillecollet.com/enterprise/remi-release-6.rpm あと、いつも使うとは限らないので、リポジトリの設定ファイルでRemiについては「enabled=0」にしておく。 -/etc/yum.repos.d/remi.repo 使うときは、次のようにオプションを指定する。 # yum --enablerepo=rpmforge <command> [<package> ...] # yum --enablerepo=remi <command> [<package> ...] **複数のリポジトリを使う場合 [#e2f78cc1] いくつかのリポジトリを組み合わせて利用する場合は、次のようにオプションを指定する。 # yum --enablerepo=epel,rpmforge,remi <command> [<package> ...] ***参考URL [#x248d921] -http://server-setting.info/centos/repository-setting.html -http://wikiwiki.jp/poiuy/?yum%A5%EA%A5%DD%A5%B8%A5%C8%A5%EA%C0%DF%C4%EA -http://wikiwiki.jp/poiuy/?yum%A5%EA%A5%DD%A5%B8%A5%C8%A5%EA%C0%DF%C4%EA%28%B3%C8%C4%A5%29 -http://www.kakiro-web.com/linux/index.html -http://centossrv.com/epel.shtml -http://centossrv.com/rpmforge.shtml -http://www.system-act.com/server/repository.html |