centos8配置yum阿里云镜像源
1 、进入配置文件
cd /etc/yum.repos.d
2、备份原有配置文件
mv CentOS-Base.repo CentOS-Base.repo.back
3、下载centos8的配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
4、修改配置文件
vim CentOS-Base.repo
底部加入:
[epel]
name=epel
baseurl=https://mirrors.aliyun.com/epel/8/Everything/x86_64/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8
(centos7的话)
[epel] name=epel
baseurl=https://mirrors.aliyun.com/epel/7/x86_64/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7
5、执行更新操作
yum -y update
6、配置过程镜像缓慢的话 镜像源
baseurl 加入
https://mirrors.huaweicloud.com/centos/8/BaseOS/x86_64/os/
https://mirrors.163.com/centos/8/BaseOS/x86_64/os/