1. centos 源更新
centos找rpm包,到/etc/yum.repos.d/*.repo 下面的对应项更新。
1.1 centos6 源更新
$ 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
$ sed -i 's/$releasever/6/g' /etc/yum.repos.d/CentOS-Base.repo
$ sed -i 's/$basearch/x86_64/g' /etc/yum.repos.d/CentOS-Base.repo
$ yum clean all
$ yum update
$ mv -f /etc/yum.repos.d/CentOS-Base.repo.backup /etc/yum.repos.d/CentOS-Base.repo
1.2 centos7 源更新
$ 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-7.repo
# $ sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo
# $ sed -i 's/$basearch/x86_64/g' /etc/yum.repos.d/CentOS-Base.repo
$ yum clean all
$ yum update
$ mv -f /etc/yum.repos.d/CentOS-Base.repo.backup /etc/yum.repos.d/CentOS-Base.repo
1.3 其它源
其它地址:
- 163:
http://mirrors.163.com/
, 对应centos6的repo文件地址为:wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
- 网易镜像源:http://mirrors.163.com/
- 清华镜像源:https://mirrors.tuna.tsinghua.edu.cn/
- 中科大的Linux安装镜像源:http://centos.ustc.edu.cn/