centos 6 切换base源

Posted 忙碌在路上

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos 6 切换base源相关的知识,希望对你有一定的参考价值。

切换为阿里云源:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo && yum makecache

 备份旧源-->下载新源-->生成缓存

 

切换为网易源:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup.ali && wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo && yum clean all && yum makecache

 

切换为epel源:

安装epel,centos6选6,5就选5

32位系统选择:

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

64位系统选择:

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

导入key:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5

如果用比较新的软件,用epel-test.repo这个文件就行了

别忘了安装yum install yum-priorities

[[email protected] yum.repos.d]# ls |grep epel
epel.repo
epel-testing.repo

 

以上是关于centos 6 切换base源的主要内容,如果未能解决你的问题,请参考以下文章

如何更换yum源文件

CentOS7切换阿里 yum 源

CentOS 7 切换为阿里源

linux CentOS虚拟机切换为阿里源

linux CentOS虚拟机切换为阿里源

CentOS 7 配置163源