歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> 學習Linux

CentOS第三方軟件庫(pbone|EPEL|RPMForge|RPMFusion)使用配置

CentOS第三方軟件庫(pbone|EPEL|RPMForge|RPMFusion)使用配置


CentOS第三方軟件庫(pbone|EPEL|RPMForge|RPMFusion)使用配置


一、准備工作,安裝yum-priorities插件

作用: 設置yum在調用軟件源時的順序

1.1 安裝:

  1. #yuminstallyum-priorities-y


1.2 設置:

/etc/yum.repos.d/*.repo, 添加順序指令 priority=N (N從1至99, 1優先級最高)

具體語法:

  1. [base],[addons],[updates],[extras]…priority=1
  2. [CentOSplus],[contrib]…priority=2


示例:

  1. [base]
  2. name=CentOS-$releasever-Base
  3. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  4. #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  5. gpgcheck=1
  6. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  7. <spanstyle="color:#FF0000;">priority=1</span>
  8. #releasedupdates
  9. [updates]
  10. name=CentOS-$releasever-Updates
  11. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  12. #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
  13. gpgcheck=1
  14. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  15. <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位系統)

  1. #wgethttp://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
  2. #rpm-Uvhepel-release-6-5.noarch.rpm


2.1.2 導入DAG的PGP Key

  1. #rpm--importhttp://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL-6


2.1.3 設置/etc/yum.repos.d/epel.repo文件中源的級別

示例:

  1. [epel]
  2. name=ExtraPackagesforEnterpriseLinux6-$basearch
  3. #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
  4. mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
  5. failovermethod=priority
  6. enabled=1
  7. gpgcheck=1
  8. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  9. priority=11
  10. [epel-debuginfo]
  11. name=ExtraPackagesforEnterpriseLinux6-$basearch-Debug
  12. #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
  13. mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
  14. failovermethod=priority
  15. enabled=0
  16. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  17. gpgcheck=1
  18. priority=11
  19. [epel-source]
  20. name=ExtraPackagesforEnterpriseLinux6-$basearch-Source
  21. #baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
  22. mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
  23. failovermethod=priority
  24. enabled=0
  25. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  26. gpgcheck=1
  27. priority=11


2.2 RPMForge

http://pkgs.repoforge.org/rpmforge-release/

2.2.1 下載與安裝RPMForge具體方法 (如RHEL/CentOS 6;32位系統)

  1. #wgethttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
  2. #rpm-Uvhrpmforge-release-0.5.2-2.el6.rf.i686.rpm

2.2.2 安裝DAG的PGP Key

  1. #rpm--importhttp://apt.sw.be/RPM-GPG-KEY.dag.txt

2.2.3 驗證rpmforge的rpm文件包

  1. #rpm-Krpmforge-release-0.5.2-2.el6.rf.*.rpm

2.2.4 安裝rpmforge的rpm文件包

  1. #rpm-irpmforge-release-0.5.2-2.el6.rf.*.rpm


2.2.5 設置/etc/yum.repos.d/rpmforge.repo文件中源的級別

示例:

  1. ###Name:RPMforgeRPMRepositoryforRHEL6-dag
  2. ###URL:http://rpmforge.net/
  3. [rpmforge]
  4. name=RHEL$releasever-RPMforge.net-dag
  5. baseurl=http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
  6. mirrorlist=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
  7. #mirrorlist=file:///etc/yum.repos.d/mirrors-rpmforge
  8. enabled=1
  9. protect=0
  10. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
  11. gpgcheck=1
  12. priority=13
  13. [rpmforge-extras]
  14. name=RHEL$releasever-RPMforge.net-extras
  15. baseurl=http://apt.sw.be/redhat/el6/en/$basearch/extras
  16. mirrorlist=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-extras
  17. #mirrorlist=file:///etc/yum.repos.d/mirrors-rpmforge-extras
  18. enabled=0
  19. protect=0
  20. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
  21. gpgcheck=1
  22. priority=13
  23. [rpmforge-testing]
  24. name=RHEL$releasever-RPMforge.net-testing
  25. baseurl=http://apt.sw.be/redhat/el6/en/$basearch/testing
  26. mirrorlist=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-testing
  27. #mirrorlist=file:///etc/yum.repos.d/mirrors-rpmforge-testing
  28. enabled=0
  29. protect=0
  30. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
  31. gpgcheck=1
  32. priority=13


2.3 RPMFusion

http://rpmfusion.org/

2.3.1 下載與安裝RPMFusion具體方法 (如RHEL/CentOS 6;32位系統)

  1. #wgethttp://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm
  2. #rpm-Uvhrpmfusion-free-release-6-0.1.noarch.rpm
  3. #wgethttp://download1.rpmfusion.org/nonfree/el/updates/testing/6/i386/rpmfusion-nonfree-release-6-0.1.noarch.rpm
  4. #rpm-Uvhrpmfusion-nonfree-release-6-0.1.noarch.rpm


2.3.2 安裝DAG的PGP Key

  1. http://rpmfusion.org/keys
  2. http://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-el-6
  3. http://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-nonfree-el-6
  4. #rpm--importRPM-GPG-KEY-rpmfusion-free-el-6
  5. #rpm--importRPM-GPG-KEY-rpmfusion-nonfree-el-6


2.3.3 設置/etc/yum.repos.d/epel.repo文件中源的級別

示例:

  1. [rpmfusion-free-updates]
  2. name=RPMFusionforEL6-Free-Updates
  3. #baseurl=http://download1.rpmfusion.org/free/el/updates/6/$basearch/
  4. mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-released-6&arch=$basearch
  5. enabled=1
  6. gpgcheck=1
  7. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
  8. priority=14
  9. [rpmfusion-free-updates-debuginfo]
  10. name=RPMFusionforEL6-Free-UpdatesDebug
  11. #baseurl=http://download1.rpmfusion.org/free/el/updates/6/$basearch/debug/
  12. mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-released-debug-6&arch=$basearch
  13. enabled=0
  14. gpgcheck=1
  15. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
  16. priority=14
  17. [rpmfusion-free-updates-source]
  18. name=RPMFusionforEL6-Free-UpdatesSource
  19. #baseurl=http://download1.rpmfusion.org/free/el/updates/6/SRPMS/
  20. mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-released-source-6&arch=$basearch
  21. enabled=0
  22. gpgcheck=1
  23. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
  24. 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替換成你的用戶名密碼並保存

示例:

  1. [74i386]
  2. name=PBONERedHatEL6i386
  3. baseurl=http://yum.pbone.net/74/i386/
  4. gpgcheck=0
  5. proxy=http://proxy.pbone.net:3127/
  6. proxy_username=ENTER_YOUR_USERNAME_HERE
  7. proxy_password=ENTER_YOUR_PASSWORD_HERE
  8. [74noarch]
  9. name=PBONERedHatEL6noarch
  10. baseurl=http://yum.pbone.net/74/noarch/
  11. gpgcheck=0
  12. proxy=http://proxy.pbone.net:3127/
  13. proxy_username=ENTER_YOUR_USERNAME_HERE
  14. proxy_password=ENTER_YOUR_PASSWORD_HERE
  15. [79i386]
  16. name=PBONECentOS6i386
  17. baseurl=http://yum.pbone.net/79/i386/
  18. gpgcheck=0
  19. proxy=http://proxy.pbone.net:3127/
  20. proxy_username=ENTER_YOUR_USERNAME_HERE
  21. proxy_password=ENTER_YOUR_PASSWORD_HERE
  22. [79noarch]
  23. name=PBONECentOS6noarch
  24. baseurl=http://yum.pbone.net/79/noarch/
  25. gpgcheck=0
  26. proxy=http://proxy.pbone.net:3127/
  27. proxy_username=ENTER_YOUR_USERNAME_HERE
  28. proxy_password=ENTER_YOUR_PASSWORD_HERE


2.4.2 設置/etc/yum.repos.d/epel.repo文件中源的級別

示例:

  1. [74i386]
  2. name=PBONERedHatEL6i386
  3. baseurl=http://yum.pbone.net/74/i386/
  4. gpgcheck=0
  5. proxy=http://proxy.pbone.net:3127/
  6. proxy_username=ENTER_YOUR_USERNAME_HERE
  7. proxy_password=ENTER_YOUR_PASSWORD_HERE
  8. priority=16
  9. [74noarch]
  10. name=PBONERedHatEL6noarch
  11. baseurl=http://yum.pbone.net/74/noarch/
  12. gpgcheck=0
  13. proxy=http://proxy.pbone.net:3127/
  14. proxy_username=ENTER_YOUR_USERNAME_HERE
  15. proxy_password=ENTER_YOUR_PASSWORD_HERE
  16. priority=16
  17. [79i386]
  18. name=PBONECentOS6i386
  19. baseurl=http://yum.pbone.net/79/i386/
  20. gpgcheck=0
  21. proxy=http://proxy.pbone.net:3127/
  22. proxy_username=ENTER_YOUR_USERNAME_HERE
  23. proxy_password=ENTER_YOUR_PASSWORD_HERE
  24. priority=16
  25. [79noarch]
  26. name=PBONECentOS6noarch
  27. baseurl=http://yum.pbone.net/79/noarch/
  28. gpgcheck=0
  29. proxy=http://proxy.pbone.net:3127/
  30. proxy_username=ENTER_YOUR_USERNAME_HERE
  31. proxy_password=ENTER_YOUR_PASSWORD_HERE
  32. priority=16


三、最後配置YUM

# yum clean all

# yum makecache

http://www.bkjia.com/Linuxjc/1156103.html TechArticle

Copyright © Linux教程網 All Rights Reserved