Centos6 换源

Posted 偏安一隅能苟生,依傍山水且独行;

tags:

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

#主要是为了提高安装速度以及epel中自带源众多木有的软件。 

#Author wood_man
#2016.06.01 v 2.0

 
1. 测试环境
VMware 10.0    
CentOS release 6.6 (Final) i386  
kernel 
2.6.32-504.el6.i686  
 
2.准备工作
(1) 删除yum源
#rm -f /etc/yum.repo.d/*
(2) 安装和配置 
网易:
#wget http://mirrors.163.com/.help/CentOS6-Base-163.repo -O /etc/yum.repos.d/163.repo 
重庆大学:
#wget http://mirrors.cqu.edu.cn/distri/CentOS/6/CentOS-Base.repo  
#网易和重庆大学的镜像配置一个即可。
epel:

#rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
#(如果报错则)epel.repo中注释所有的"#mirrorlist"使用"baseurl"并且"enabled=1"。
#sed -r -i ‘[email protected]#(baseurl)@\[email protected]‘ epel.repo
# sed -i ‘[email protected]@#&@g‘ epel.repo
 
本地源 :
#cat /etc/yum.repos.d/local.repo
[Local]
name=Centos6 - Local
enabled=1
gpgcheck=0 
 
#yum clean all 
#yum makecache 
#慎用缓存到本地安装速度快,但占用带宽和磁盘;缓存位置在/etc/yum.conf定义。
#yum repolist
 

#删除epel
rpm -e --nodeps(强制)  epel-release

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

CentOS yum换源

centOS6.6安装图解

centOS6.6安装图解

centos6.5内核升级

centos6实现PXE自动化安装centos6

Docker支持centos6系统吗?