Loading
0

CentOS8.x系统停止维护yum无法使用解决方法
被墙跳转TG:@qianhenetwork QQ 851617266

301免备案跳转微信公众号
腾讯云服务器大促销。
华为服务器
前言:2022年1月1日CentOS8已经不在维护了,随之自带的yum源也无法使用,yum安装会报错:Repository AppStream is listed more than once in the configuration Repository extras is listed more than once in the configuration 或者为 repo 'AppStream' 下载元数据失败  错误:为 repo 'AppStream' 下载元数据失败,完整的报错可参考如下信息,本文将介绍如何更改centos8的yum源达到使用的目的

 

[[email protected] ~]# yum clean all && yum makecache
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
36 文件已删除
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
CentOS-8 - AppStream                                                              6.9 kB/s | 2.3 kB     00:00    
为 repo 'AppStream' 下载元数据失败
错误:为 repo 'AppStream' 下载元数据失败

解决方法:可参考如下方法更换yum源
如果使用的是阿里云的服务器,可参考教程 https://www.zfcdn.xyz/showinfo-3-36184-0.html 操作
1、将/etc/yum.repos.d目录改名备份,并重新创建新的/etc/yum.repos.d目录

mv /etc/yum.repos.d /etc/yum.repos.d.backup

mkdir /etc/yum.repos.d

2、执行如下命令下载阿里云公共的yum镜像文件(wget及crul方式选择其中一种即可)

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

若服务器提示没安装wget命令,可执行如下命令下载yum源

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

3、执行如下命令重新创建缓存

yum clean all && yum makecache

若执行没有报错则表示正常,成功的提示可参考如下:

[[email protected] ~]#  yum clean all && yum makecache
0 文件已删除
CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                                                           4.4 MB/s | 4.6 MB     00:01    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                                                                        26 kB/s |  10 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                                                            4.7 MB/s | 8.4 MB     00:01    
元数据缓存已建立。

随后可测试yum安装软件看是否正常。




 
301免备案跳转微信公众号
华为服务器
腾讯云服务器大促销。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:https://www.zfcdn.xyz/showinfo-3-36185-0.html
亲爱的:被墙域名跳转TG:@qianhenetwork QQ:851617266,可否收藏+评论+分享呢?
上一篇:阿里云CentOS 8.x系统yum报404的解决方法(Errors during downloading metadata for repository 'appstream':
下一篇:阿里云ECS服务器搭建Docker后端口通但外部无法访问Docker解决方法