linux上yum镜像源切换

有一些服务商的系统给默认YUM源设置的是国外的,这样就会导致下载速度缓慢。国内几家比较热门的镜像点,下面的镜像全部支持Linux的任何一个发行版的系统。
(1).阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/
CentOS系统更换软件安装源
第一步:备份原镜像文件,以免出错后可以恢复。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
第三步:运行yum makecache生成缓存
yum makecache
(2).163安装软件镜像源
163开源镜像站是国内比较老的一个网站,很多人都在使用。
网易开源镜像站:http://mirrors.163.com/
CentOS系统更换软件安装源
第一步:备份原镜像文件,以免出错后可以恢复。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
最后统一执行:cp -rp CentOS7-Base-163.repo CentOS-Base.repo
第三步:运行以下命令生成缓存
yum clean all
yum makecache
除了网易之外,国内还有其他不错的yum源,比如中科大和搜狐的等,可以根据自己需求下载
中科大的Linux安装镜像源:http://centos.ustc.edu.cn/
搜狐的Linux安装镜像源:http://mirrors.sohu.com/
北京首都在线科技:http://mirrors.yun-idc.com/




更多推荐
所有评论(0)