CentOS Linux 8 - AppStream 错误:为 repo ‘appstream

所遇问题

错误:为仓库 ‘appstream’ 下载元数据失败

问题原因:
CentOS Linux 8在2022年12月31日来到生命周期终点(End of Life,EoL)。即CentOS Linux 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。所以原来的CentOS Linux 8的yum源也都失效了!最终导致此问题的产生。

问题解决:

更改CentOS Linux 8的yum源

步骤:先到yum目录文件-->建立备份-->删除原yum文件

[root@centos8 admin]# cd /etc/yum.repos.d/
[root@centos8 yum.repos.d]# ls -l
总用量 48
-rw-r--r--. 1 root root  719 11月  9 2020 CentOS-Linux-AppStream.repo
-rw-r--r--. 1 root root  704 11月  9 2020 CentOS-Linux-BaseOS.repo
-rw-r--r--. 1 root root 1130 11月  9 2020 CentOS-Linux-ContinuousRelease.repo
-rw-r--r--. 1 root root  318 11月  9 2020 CentOS-Linux-Debuginfo.repo
-rw-r--r--. 1 root root  732 11月  9 2020 CentOS-Linux-Devel.repo
-rw-r--r--. 1 root root  704 11月  9 2020 CentOS-Linux-Extras.repo
-rw-r--r--. 1 root root  719 11月  9 2020 CentOS-Linux-FastTrack.repo
-rw-r--r--. 1 root root  740 11月  9 2020 CentOS-Linux-HighAvailability.repo
-rw-r--r--. 1 root root  693 11月  9 2020 CentOS-Linux-Media.repo
-rw-r--r--. 1 root root  706 11月  9 2020 CentOS-Linux-Plus.repo
-rw-r--r--. 1 root root  724 11月  9 2020 CentOS-Linux-PowerTools.repo
-rw-r--r--. 1 root root  898 11月  9 2020 CentOS-Linux-Sources.repo
[root@centos8 yum.repos.d]# mkdir bak
[root@centos8 yum.repos.d]# ls -l
总用量 48
drwxr-xr-x. 2 root root    6 10月 12 02:36 bak
-rw-r--r--. 1 root root  719 11月  9 2020 CentOS-Linux-AppStream.repo
-rw-r--r--. 1 root root  704 11月  9 2020 CentOS-Linux-BaseOS.repo
-rw-r--r--. 1 root root 1130 11月  9 2020 CentOS-Linux-ContinuousRelease.repo
-rw-r--r--. 1 root root  318 11月  9 2020 CentOS-Linux-Debuginfo.repo
-rw-r--r--. 1 root root  732 11月  9 2020 CentOS-Linux-Devel.repo
-rw-r--r--. 1 root root  704 11月  9 2020 CentOS-Linux-Extras.repo
-rw-r--r--. 1 root root  719 11月  9 2020 CentOS-Linux-FastTrack.repo
-rw-r--r--. 1 root root  740 11月  9 2020 CentOS-Linux-HighAvailability.repo
-rw-r--r--. 1 root root  693 11月  9 2020 CentOS-Linux-Media.repo
-rw-r--r--. 1 root root  706 11月  9 2020 CentOS-Linux-Plus.repo
-rw-r--r--. 1 root root  724 11月  9 2020 CentOS-Linux-PowerTools.repo
-rw-r--r--. 1 root root  898 11月  9 2020 CentOS-Linux-Sources.repo
[root@centos8 yum.repos.d]# mv CentOS-* bak
[root@centos8 yum.repos.d]# ls -l
总用量 4
drwxr-xr-x. 2 root root 4096 10月 12 02:36 bak

下载为阿里云的镜像文件:

centso8的yum源

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

centos7的yum源

wget -O /etc/yum.repos.d/CenOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

建立新的元数据缓存:yum makecache

[root@centos8 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2022-10-12 02:37:52--  https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 58.49.162.238, 58.49.162.237, 120.39.196.242, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|58.49.162.238|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2495 (2.4K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

/etc/yum.repos.d/Ce 100%[===================>]   2.44K  --.-KB/s  用时 0.007s  

2022-10-12 02:37:53 (346 KB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2495/2495])

[root@centos8 yum.repos.d]# ls
bak  CentOS-Base.repo
[root@centos8 yum.repos.d]# yum makecache
CentOS-8.5.2111 - Base - mirrors.aliyun.com      33 kB/s | 3.9 kB     00:00    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com    19 kB/s | 1.5 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.co  19 kB/s | 4.3 kB     00:00    
元数据缓存已建立。

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值