1 进入yum目录
[root@test-138 ~]# cd /etc/yum.repos.d/ [root@test-138 yum.repos.d]# ll -rw-r--r-- 1 root root 810 Jan 9 21:26 CentOS-AppStream.repo -rw-r--r-- 1 root root 788 Jan 9 21:24 CentOS-Base.repo -rw-r--r-- 1 root root 832 Jan 9 21:26 CentOS-Extras.repo
2 将mirrorlist注释掉,缓存阿里的,gpgcheck换成0(暂不知道原因)
CentOS-AppStream.repo:
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=0
CentOS-BaseOS.repo:
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=0
CentOS-Extras.repo:
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
gpgcheck=0
3 清空,重新缓存
[root@test-138 yum.repos.d]# yum clean all 0 files removed [root@test-138 yum.repos.d]# yum makecache CentOS-8 - AppStream
4 参考来源:
https://www.bilibili.com/video/BV1uZ4y1W7NT?from=search&seid=6799567751256323091
https://www.cnblogs.com/jet-chen/p/13041668.html