CentOS 8 同步仓库缓存失败解决方案

//以下操作需要 root 权限

//进入 repo 目录

cd /etc/yum.repos.d

//建议备份原文件

cp CentOS-Base.repo CentOS-Base.repo.bak

//AppStream 和 Extras 方法同上

vim CentOS-Base.repo

//修改为以下内容

[BaseOS]

name=CentOS-$releasever - Base

baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

vim CentOS-AppStream.repo

//修改内容

[AppStream]

name=CentOS-$releasever - AppStream

baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

vim CentOS-Extras.repo

//修改内容

[extras]

name=CentOS-$releasever - Extras

baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

//清除缓存

yum clean all

//建立缓存

yum makecache

上一篇:第四周欢迎Birck批改


下一篇:CentOS7 yum换阿里源