小舞最近用腾讯云的时候各种问题,安装包安装到一半就出问题了,快把我烦死了,还巨卡,果断换成阿里云的安装源,百度了下,果然灰常简单。

现在大家对阿里云应该没什么戒心了吧。
第一步:备份你的原镜像文件,以免出错后可以恢复。

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

然后分为三种,5、6、7

centos5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

centos6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

centos7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

最后清理缓存

yum clean all

重建缓存

yum makecache

若使用阿里云服务器,将源的域名从mirrors.aliyun.com改为mirrors.aliyuncs.com,不占用公网流量。

打字完毕收工!

发表回复

后才能评论