CentOS与RHEL系列安装epel和rpmforce源

很多时候,使用CentOS自带的软件源并不能解决所有的软件依赖包。这里介绍在CentOS或RHEL系列中安装epel源和rpmforce源

安装epel源


CentOS5 Or RHEL5 32bit

1
rpm -ivh http://mirrors.kernel.org/fedora-epel/5/i386/epel-release-5-4.noarch.rpm

CentOS5 Or RHEL5 64bit

1
rpm -ivh http://mirrors.kernel.org/fedora-epel/5/x86_64/epel-release-5-4.noarch.rpm

CentOS6 Or RHEL6 32bit

1
rpm -ivh http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm

CentOS6 Or RHEL6 64bit

1
rpm -ivh http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

CentOS7 Or RHEL7 64bit

1
rpm -ivh http://mirrors.kernel.org/fedora-epel/7/x86_64/e/epel-release-7-5.noarch.rpm

测试

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@rhel65-test-1 ~]# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* epel: mirrors.opencas.cn
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
repo id repo name status
base CentOS-6 - Base 6,575
epel Extra Packages for Enterprise Linux 6 - x86_64 11,780
extras CentOS-6 - Extras 43
updates CentOS-6 - Updates 439
repolist: 18,837

#安装rpmforce源


CentOS5 Or RHEL5 32bit

1
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm

CentOS5 Or RHEL5 64bit

1
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

CentOS6 Or RHEL6 32bit

1
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

CentOS6 Or RHEL6 64bit

1
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@rhel65-test-1 ~]# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* epel: mirrors.opencas.cn
* extras: mirrors.yun-idc.com
* rpmforge: mirrors.neusoft.edu.cn
* updates: mirrors.yun-idc.com
repo id repo name status
base CentOS-6 - Base 6,575
epel Extra Packages for Enterprise Linux 6 - x86_64 11,780
extras CentOS-6 - Extras 43
rpmforge RHEL 6 - RPMforge.net - dag 4,718
updates CentOS-6 - Updates 439
repolist: 23,555

附录:内置源替换为163源

  • 收录架构

    i386
    x86_64
    SRPMS

  • 收录版本

    所有版本

  • 更新时间

    每4小时更新一次

  • 使用说明

    首先备份/etc/yum.repos.d/CentOS-Base.repo

1
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  • 下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

CentOS7
CentOS6
CentOS5

  • 运行以下命令生成缓存
1
2
yum clean all
yum makecache

相关连接:163yum源官方帮助