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源的主要内容,如果未能解决你的问题,请参考以下文章