CentOS7系统更换软件安装源
===

阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/ 。

第一步:备份你的原镜像文件,以免出错后可以恢复。

cp /etc/yum.repos.d/CentOS-Base.repo{,.backup}
# 或者
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/

如果 wget 没有安装,运行下面命令安装 wget 软件。

yum update --skip-broken
yum -y install wget

安装完成更新下载源

# 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
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

第三步:运行yum makecache生成缓存

yum clean all
yum makecache

yum 安装报错

File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:

解决:修改文件/usr/bin/yum、/usr/libexec/urlgrabber-ext-down头中相应python为#!/usr/bin/python2.7

163官方说明:

http://mirrors.163.com/
http://mirrors.163.com/.help/centos.html

中国开源镜像站点

  • 阿里云开源镜像站:http://mirrors.aliyun.com/
  • 网易开源镜像站:http://mirrors.163.com/
  • 搜狐开源镜像站:http://mirrors.sohu.com/
  • 北京交通大学:http://mirror.bjtu.edu.cn/cn/
  • 兰州大学:http://mirror.lzu.edu.cn/
  • 厦门大学:http://mirrors.xmu.edu.cn/
  • 上海交通大学:http://ftp.sjtu.edu.cn/
  • 清华大学:http://mirrors.tuna.tsinghua.edu.cn/
    • http://mirrors.6.tuna.tsinghua.edu.cn/
    • http://mirrors.4.tuna.tsinghua.edu.cn/
  • 天津大学:http://mirror.tju.edu.cn/
  • 中国科学技术大学:http://mirrors.ustc.edu.cn/
    • http://mirrors4.ustc.edu.cn/
    • http://mirrors6.ustc.edu.cn/
  • 西南大学:http://linux.swu.edu.cn/swudownload/
  • 泰安移动:http://mirrors.ta139.com/
  • 东北大学:http://mirror.neu.edu.cn/
  • 浙江大学:http://mirrors.zju.edu.cn/
  • 东软信息学院:http://mirrors.neusoft.edu.cn/