欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

Centos更新yum源出现AppStream‘缓存失败,忽略这个repo。同步仓库‘base‘缓存失败,忽略这个repo的问题,踩坑记录

时间:2023-05-16

今天在安装docker 镜像和容器,发现国外的yum源没办法更新,然后尝试更换aliyun 源,结果出现了几个大坑,在此记录,希望后续的兄弟们别掉坑里。

首先修改 CentOS-base.repo , root 下执行 vim CentOS-base.repo

需改内容如下:

# CentOS-base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client、 You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.##[base]name=CentOS-8.5.2111 - base - mirrors.aliyun.combaseurl=http://mirrors.cloud.tencent.com/centos/$releasever/baseOS/$basearch/os/gpgcheck=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official#additional packages that may be useful[extras]name=CentOS-8.5.2111 - Extras - mirrors.aliyun.combaseurl=http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/os/gpgcheck=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official#additional packages that extend functionality of existing packages[centosplus]name=CentOS-8.5.2111 - Plus - mirrors.aliyun.combaseurl=http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/os/gpgcheck=0enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official[PowerTools]name=CentOS-8.5.2111 - PowerTools - mirrors.aliyun.combaseurl=http://mirrors.cloud.tencent.com/centos/$releasever/PowerTools/$basearch/os/gpgcheck=0enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official[AppStream]name=CentOS-8.5.2111 - AppStream - mirrors.aliyun.combaseurl=http://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/gpgcheck=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

这里需要注意,网络流传版本的结果方法其他地方都没有问题,但是就这个节点:[AppStream]
路径要注意,不能用 releasever 来通配版本号,事实上我发现阿里云的源这里已经换成了 8-stream
正确的应该是 baseurl=http://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/
然后继续修改 CentOS-AppStream.repo root 下执行命令 vim CentOS-AppStream.repo

#CentOS-AppStream.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client、 You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.##[AppStream]name=CentOS-$releasever - AppStreambaseurl=http://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/gpgcheck=0enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

这里也一样,
正确的应该是 baseurl=http://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/
然后 yum clean all yum makecache 重建元数据缓存,此时就可以看到docker 的更新源文件了。

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。