天天看点

Centos7安装阿里云镜像源

下载阿里云提供的 repo 文件到原始目录。

这里以 CentOS 7 为例。(有两种方式,CentOS 6 或 8 只需要更改后边响应的数字即可。)

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

or

$ curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

Step 4

清空缓存文件,并重新生成缓存文件。

# 1. 清空缓存

$ yum clean all

继续阅读