Centos(Yum源更改)
第一步:备份你的原镜像文件,以免出错后可以恢复。
[root@openstack yum.repos.d]#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 [root@openstack yum.repos.d]#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo CentOS 6 [root@openstack yum.repos.d]#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo CentOS 7 [root@openstack yum.repos.d]#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
第三步:运行yum makecache生成缓存
【保证CentOS-Media.repo文件里的enabled=0(默认就是为0),使其为不生效】
[root@openstack yum.repos.d]#yum clean all [root@openstack yum.repos.d]#yum makecache