当前位置: 首页 > 工具软件 > AppStream > 使用案例 >

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

夏骞尧
2023-12-01

所遇问题

错误:为仓库 ‘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

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

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.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    
元数据缓存已建立。

 类似资料: