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
|