CentOS第三方軟件庫(pbone|EPEL|RPMForge|RPMFusion)使用配置
CentOS第三方軟件庫(pbone|EPEL|RPMForge|RPMFusion)使用配置
一、准備工作,安裝yum-priorities插件
作用: 設置yum在調用軟件源時的順序
1.1 安裝:
- #yuminstallyum-priorities-y
1.2 設置:
/etc/yum.repos.d/*.repo, 添加順序指令 priority=N (N從1至99, 1優先級最高)
具體語法:
- [base],[addons],[updates],[extras]…priority=1
- [CentOSplus],[contrib]…priority=2
- …
示例:
- [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
- <spanstyle="color:#FF0000;">priority=1</span>
- #releasedupdates
- [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
- <spanstyle="color:#FF0000;">priority=1</span>
二、下載、安裝並配置EPEL|RPMForge|RPMFusion對應的RPM文件包
需要了解系統內核信息, 使用 uname -r 命令來查看
2.1 EPEL
http://fedoraproject.org/wiki/EPEL
2.1.1 下載與安裝EPEL具體方法 (如RHEL/CentOS 6;32位系統)
- #wgethttp://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
- #rpm-Uvhepel-release-6-5.noarch.rpm
2.1.2 導入DAG的PGP Key
- #rpm--importhttp://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL-6
2.1.3 設置/etc/yum.repos.d/epel.repo文件中源的級別
示例:
- [epel]
- name=ExtraPackagesforEnterpriseLinux6-$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=11
- [epel-debuginfo]
- name=ExtraPackagesforEnterpriseLinux6-$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=11
- [epel-source]
- name=ExtraPackagesforEnterpriseLinux6-$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=11
2.2 RPMForge
http://pkgs.repoforge.org/rpmforge-release/
2.2.1 下載與安裝RPMForge具體方法 (如RHEL/CentOS 6;32位系統)
- #wgethttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
- #rpm-Uvhrpmforge-release-0.5.2-2.el6.rf.i686.rpm
2.2.2 安裝DAG的PGP Key
- #rpm--importhttp://apt.sw.be/RPM-GPG-KEY.dag.txt
2.2.3 驗證rpmforge的rpm文件包
- #rpm-Krpmforge-release-0.5.2-2.el6.rf.*.rpm
2.2.4 安裝rpmforge的rpm文件包
- #rpm-irpmforge-release-0.5.2-2.el6.rf.*.rpm
2.2.5 設置/etc/yum.repos.d/rpmforge.repo文件中源的級別
示例:
- ###Name:RPMforgeRPMRepositoryforRHEL6-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=13
- [rpmforge-extras]
- name=RHEL$releasever-RPMforge.net-extras
- baseurl=http://apt.sw.be/redhat/el6/en/$basearch/extras
- mirrorlist=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-extras
- #mirrorlist=file:///etc/yum.repos.d/mirrors-rpmforge-extras
- enabled=0
- protect=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
- gpgcheck=1
- priority=13
- [rpmforge-testing]
- name=RHEL$releasever-RPMforge.net-testing
- baseurl=http://apt.sw.be/redhat/el6/en/$basearch/testing
- mirrorlist=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-testing
- #mirrorlist=file:///etc/yum.repos.d/mirrors-rpmforge-testing
- enabled=0
- protect=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
- gpgcheck=1
- priority=13
2.3 RPMFusion
http://rpmfusion.org/
2.3.1 下載與安裝RPMFusion具體方法 (如RHEL/CentOS 6;32位系統)
- #wgethttp://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm
- #rpm-Uvhrpmfusion-free-release-6-0.1.noarch.rpm
- #wgethttp://download1.rpmfusion.org/nonfree/el/updates/testing/6/i386/rpmfusion-nonfree-release-6-0.1.noarch.rpm
- #rpm-Uvhrpmfusion-nonfree-release-6-0.1.noarch.rpm
2.3.2 安裝DAG的PGP Key
- http://rpmfusion.org/keys
- http://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-el-6
- http://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-nonfree-el-6
- #rpm--importRPM-GPG-KEY-rpmfusion-free-el-6
- #rpm--importRPM-GPG-KEY-rpmfusion-nonfree-el-6
2.3.3 設置/etc/yum.repos.d/epel.repo文件中源的級別
示例:
- [rpmfusion-free-updates]
- name=RPMFusionforEL6-Free-Updates
- #baseurl=http://download1.rpmfusion.org/free/el/updates/6/$basearch/
- mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-released-6&arch=$basearch
- enabled=1
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
- priority=14
- [rpmfusion-free-updates-debuginfo]
- name=RPMFusionforEL6-Free-UpdatesDebug
- #baseurl=http://download1.rpmfusion.org/free/el/updates/6/$basearch/debug/
- mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-released-debug-6&arch=$basearch
- enabled=0
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
- priority=14
- [rpmfusion-free-updates-source]
- name=RPMFusionforEL6-Free-UpdatesSource
- #baseurl=http://download1.rpmfusion.org/free/el/updates/6/SRPMS/
- mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-released-source-6&arch=$basearch
- enabled=0
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
- priority=14
2.4 pbone
http://rpm.pbone.net/
需要注冊,免費15天
2.4.1 下載與安裝pbone具體方法 (如RHEL/CentOS 6;32位系統)
進入網址http://rpm.pbone.net/在YUM REPO中選擇所需軟件包類型生成YUM conf
進入/etc/yum.repos.d/, 建立/etc/yum.repos.d/pbone.repo文件
把上步生成的文字復制進去,將ENTER_YOUR_USERNAME_HERE和ENTER_YOUR_PASSWORD_HERE替換成你的用戶名密碼並保存
示例:
- [74i386]
- name=PBONERedHatEL6i386
- baseurl=http://yum.pbone.net/74/i386/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
- [74noarch]
- name=PBONERedHatEL6noarch
- baseurl=http://yum.pbone.net/74/noarch/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
- [79i386]
- name=PBONECentOS6i386
- baseurl=http://yum.pbone.net/79/i386/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
- [79noarch]
- name=PBONECentOS6noarch
- baseurl=http://yum.pbone.net/79/noarch/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
2.4.2 設置/etc/yum.repos.d/epel.repo文件中源的級別
示例:
- [74i386]
- name=PBONERedHatEL6i386
- baseurl=http://yum.pbone.net/74/i386/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
- priority=16
- [74noarch]
- name=PBONERedHatEL6noarch
- baseurl=http://yum.pbone.net/74/noarch/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
- priority=16
- [79i386]
- name=PBONECentOS6i386
- baseurl=http://yum.pbone.net/79/i386/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
- priority=16
- [79noarch]
- name=PBONECentOS6noarch
- baseurl=http://yum.pbone.net/79/noarch/
- gpgcheck=0
- proxy=http://proxy.pbone.net:3127/
- proxy_username=ENTER_YOUR_USERNAME_HERE
- proxy_password=ENTER_YOUR_PASSWORD_HERE
- priority=16
三、最後配置YUM
# yum clean all
# yum makecache
http://www.bkjia.com/Linuxjc/1156103.html TechArticle