Linux拥有众多的发行版,每个发行版都有提供镜像,但是,有些镜像的下载速度参差不齐,偶尔会有更新失败的情况。
下面以修改 CentOS 软件源为 小鸟云为例进行说明(镜像地址/香港节点镜像地址):
1、备份原配置文件
# cp /etc/yum.repos.d/CentOS-base.repo /etc/yum.repos.d/CentOS-base.repo.backup
2、下载新的CentOS-base.repo 到/etc/yum.repos.d/
CentOS 5
# curl -o /etc/yum.repos.d/CentOS-base.repo http://mirrors.niaoyun.com/repo/CentOS5-base.repo
CentOS 6
# curl -o /etc/yum.repos.d/CentOS-base.repo http://mirrors.niaoyun.com/repo/CentOS6-base.repo
CentOS 7
# curl -o /etc/yum.repos.d/CentOS-base.repo http://mirrors.niaoyun.com/repo/CentOS7-base.repo
如果是香港节点:
CentOS 5
# curl -o /etc/yum.repos.d/CentOS-base.repo http://hk.mirrors.niaoyun.com/repo/CentOS5-base.repo
CentOS 6
# curl -o /etc/yum.repos.d/CentOS-base.repo http://hk.mirrors.niaoyun.com/repo/CentOS6-base.repo
CentOS 7
# curl -o /etc/yum.repos.d/CentOS-base.repo http://hk.mirrors.niaoyun.com/repo/CentOS7-base.repo
3、生成缓存
# yum makecache
|