CentOS5/6 配置yum源

大纲

一、准备工作

二、CentOS5

三、CentOS6

四、测试



一、准备工作

先备份系统自带的yum源

[root@soysauce yum.repos.d]# cd /etc/yum.repos.d/
[root@soysauce yum.repos.d]# mv CentOS-Base.repo{,.back}

二、CentOS5

1).163源

[root@soysauce yum.repos.d]# wget http://mirrors.163.com/.help/CentOS5-Base-163.repo

2).sohu源

[root@soysauce yum.repos.d]# wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

3).epel源

[root@soysauce yum.repos.d]# wget /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-5.repo

4).rpmforge源 

1.下载rpmforge源

32位:

[root@soysauce yum.repos.d]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm

64位:

[root@soysauce yum.repos.d]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

2.安装DAG的GPG Key

[root@soysauce yum.repos.d]# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

3.校验rpm包

[root@soysauce yum.repos.d]# rpm -K rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

4.安装rpm包

[root@soysauce yum.repos.d]# rpm -ivh rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm


三、CentOS6

1).163源

[root@soysauce yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

2).soho源

[root@soysauce yum.repos.d]# wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

3).epel源

[root@soysauce yum.repos.d]# wget /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo

4).rpmforge源

1.下载rpmforge源

32位:

[root@soysauce yum.repos.d]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i386.rpm

64位:

[root@soysauce yum.repos.d]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

2.安装DAG的GPG Key

[root@soysauce yum.repos.d]# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

3.校验rpm包

[root@soysauce yum.repos.d]# rpm -K rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

4.安装rpm包

[root@soysauce yum.repos.d]# rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm


四、测试

[root@soysauce yum.repos.d]# yum clean all
[root@soysauce yum.repos.d]# yum repolist
Loaded plugins: priorities, security
repo id                               repo name                                                                   status
base                                  CentOS-5 - Base - mirrors.aliyun.com                                         3,667
epel                                  Extra Packages for Enterprise Linux 5 - x86_64                               6,823
extras                                CentOS-5 - Extras - mirrors.aliyun.com                                         266
rpmforge                              RHEL 5 - RPMforge.net - dag                                                 11,403
updates                               CentOS-5 - Updates - mirrors.aliyun.com                                        516
repolist: 22,675
[root@soysauce yum.repos.d]# yum makecache


ps:我这里只添加了epel源和rpmforge源,到此基本yum源配置算是完成


本文出自 “Hello,Linux” 博客,转载请与作者联系!

你可能感兴趣的:(yum源)