centos8在更新yum源时提示失败 错误:为 repo ‘AppStream’下载元数据失败
https://blog.csdn.net/Remberthename/article/details/124070710
centos8在更新yum源时提示
失败 错误:为 repo 'AppStream’下载元数据失败
解决方法:
原因:因原有系统中使用的镜像访问地址在国内访问过慢导致
解决方案:
1、将目录切换到/etc/yum.repos.d目录下
2、修改CentOS-Linux-AppStream.repo、CentOS-Linux-BaseOS.repo、CentOS-Linux-Extras.repo三个文件
3、修改CentOS-Linux-BaseOS.repo
将mirrorlist地址注释掉,取消baseurl的注释,将baseurl的指向地址更改为阿里云镜像的地址
[BaseOS]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/8-stream/BaseOS/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[AppStream] name=CentOS-$releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/8-stream/AppStream/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras] name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/8-stream/extras/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
6、修改完文件后保存,清楚缓存,从新生成元数据
##清楚缓存
yum clean all
##生成元数据
yum makecache