自宅サーバー ≫ Linux Server ≫ CentOS 6.5 ≫ yum 用リポジトリ追加

 
yum 用リポジトリのインストール
 
 
[root@centos]# yum -y install yum-priorities    <--- 入力
 
[root@centos]# yum -y install yum-plugin-priorities      <--- 入力
 
リポジトリ設定ファイルの編集
 
 
[root@centos]# vi /etc/yum.repos.d/CentOS-Base.repo    <--- 入力
 [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    <--- 追記

 #released updates
 [updates]
 name=CentOS-$releasever - Updates
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=
 updates
 #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
 
priority=1    <--- 追記

 #additional packages that may be useful
 [extras]
 name=CentOS-$releasever - Extras
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=
 extras
 #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
 
priority=2    <--- 追記

 #additional packages that extend functionality of existing packages
 [centosplus]
 name=CentOS-$releasever - Plus
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
 #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
 gpgcheck=1
 enabled=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
 
priority=2    <--- 追記

 #contrib - packages by Centos Users
 [contrib]
 name=CentOS-$releasever - Contrib
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
 #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
 gpgcheck=1
 enabled=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
 
priority=2    <--- 追記 
 
GPGキーのインストール
 
 
[root@centos]# wget http://apt.sw.be/RPM-GPG-KEY.dag.txt    <--- 入力
 
[root@centos]# rpm --import RPM-GPG-KEY.dag.txt     <--- 入力
 
[root@centos]# rm -f RPM-GPG-KEY.dag.txt    <--- 入力
 
RPMforge  のインストール
32bit用
 
 
[root@centos]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-1.
                                                              
el6.rf.i686.rpm    <--- 1行で入力
 
[root@centos]# rpm -ivh rpmforge-release-0.5.2-1.el6.rf.i686.rpm     <--- 入力
 
64bit用
 
 
[root@centos]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-1.
                                                             
el6.rf.x86_64.rpm    <--- 1行で入力
 
[root@centos]# rpm -ivh rpmforge-release-0.5.2-1.el6.rf.x86_64.rpm     <--- 入力
 
rpmforge.repo の設定
 
 
[root@centos]# vi /etc/yum.repos.d/rpmforge.repo    <--- 入力 
 ### Name: RPMforge RPM Repository for RHEL 6 - dag
 ### URL: http://rpmforge.net/
 [rpmforge]
 name = RHEL $releasever - RPMforge.net - dag
 baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
 mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
 #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
 enabled = 1
 protect = 0
 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
 gpgcheck = 1
 
priority=2    <--- 追記 
 
 EPEL の追加
 
 
[root@centos]# wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt    <--- 入力
 
[root@centos]# rpm --import RPM-GPG-KEY.dag.txt     <--- 入力
 
[root@centos]# rm -f RPM-GPG-KEY.dag.txt    <--- 入力 
 
[root@centos]# wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/i386/
                                                      epel-release-6-5.noarch.rpm
    <--- 1行で入力
 
[root@centos]# rpm -ivh epel-release-6-5.noarch.rpm     <--- 入力
 
[root@centos]# rm -f epel-release-6-5.noarch.rpm    <--- 入力 
 
epel.repo の設定
 
 
[root@centos]# vi /etc/yum.repos.d/epel.repo    <--- 入力 
 [epel]
 name=Extra Packages for Enterprise Linux 6 - $basearch
 #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
 failovermethod=priority
 enabled=1
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 
 
priority=2    <--- 追記

 [epel-debuginfo]
 name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
 #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
 failovermethod=priority
 enabled=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 gpgcheck=1 
 
priority=2    <--- 追記

 [epel-source]
 name=Extra Packages for Enterprise Linux 6 - $basearch - Source
 #baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
 failovermethod=priority
 enabled=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 gpgcheck=1 
 
priority=2    <--- 追記
 
yum のアップデート
 
 
[root@centos]# yum -y update rpmforge-release    <--- 入力
 
パッケージの優先度(priority=X)で base と updates を1番目に、その他を2番目に設定し、RPMforge ・ EPEL からも通常の yum コマンドでインストールできる

戻る