进行yum makecache时出现一下问题
感觉是源镜像库出l问题,于是百度后要更换yum镜像源的baseurl
cd /etc/yum.repo.d
vim CentOS-Linux-AppStream.repo
CentOS7配置文件名叫CentOS-AppStream.repo,有点坑。搞得自己vim时创建了新的配置文件,yum时又出现了多个镜像源冲突的问题。
CentOS8叫以下
CentOS-Linux-AppStream.repo 配置文件
[appstream]
name=CentOS Linux $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirrors.cloud.aliyuncs.com/$contentdir/$releasever/AppStream/$basearch/os/
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
百度上很多关于这个问题都是把地址换成
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
但是我试了很多次都没有效果,最后看到一片博主写的才最后解决
https://blog.youkuaiyun.com/weixin_40548480/article/details/122772932
后面发现要把地址加上$releasever-stream,换成如下才解决
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
然后执行yum makecache又出现了新的问题
Errors during downloading metadata for repository 'baseos':
- Status code: 404 for https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 106.15.218.231)
Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
很明显,是BaseOS出现了问题
如法炮制
找到CentOS-Linux-BaseOS.repo配置文件
把baseurl换成
#baseurl=http://mirrors.cloud.aliyuncs.com/$contentdir/$releasever/BaseOS/$basearch/os/
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/BaseOS/$basearch/os/
最后执行
yum clean all
yum makecache
搞定
这个问了折腾了两个小时才解决,网上大多数关于这个问题的解决办法都是比较相同,没找到有效的解决办法。