摘自:http://www.hiceon.com/topic/centos-6-config-163-yum/
1.下载repo文件
- wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
2.备份并替换系统的repo文件
- [root@localhost ~]# cd /etc/yum.repos.d/
- [root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
- [root@localhost ~]# mv CentOS6-Base-163.repo CentOS-Base.repo
3.执行yum源更新
- [root@localhost ~]# yum clean all
- [root@localhost ~]# yum makecache
- [root@localhost ~]# yum update
另外和种办法好用:摘自:http://www.ctyun.cn/bbs/forum.php?mod=viewthread&tid=1023&page=1#!/bin/sh # install epel su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm' rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 # install rpmfusion su -c 'yum localinstall -y --nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/x86_64/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/rpmfusion-nonfree-release-6-1.noarch.rpm' # update base repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget http://mirrors.163.com/.help/CentOS6-Base-163.repo mv CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo yum install -y yum-priorities yum makecache # update yum update -yrpm源:摘自:http://www.linuxidc.com/Linux/2012-06/62964.htmrpmforge源可以在 http://pkgs.repoforge.org/rpmforge-release/中下载安装,名为rpmforge-release-*.i686.rpm 或 rpmforge-release-*.x86_64.rpm,找最新的版本
epel源可以在http://mirrors.ustc.edu.cn/Fedora/epel/6/ 中找到,32系统在i386文件夹中,64位的在x86_64文件夹中,名为epel-release-6-*.noarch.rpm,找最新的版本
这里以32位系统为例子,
- #如果提示The requested URL returned error: 404,请自行换成最新的版本
- rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
- rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
摘自:http://panguohui.blog.51cto.com/1866059/827987首先,安装对应的Release档案:rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm接着,更新套件库:yum update更新后,可以透过 yum repolist 看到套件库清单中已经有一个新的套件库,名称为 epel