执行 yum makecache 时失败

来源:2-3 粮仓补给站 - 镜像源与软件安装

藩王

2024-01-16

[root@localhost etc]# cd /
[root@localhost /]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo
--2024-01-16 15:29:40--  http://mirrors.cloud.tencent.com/repo/centos8_base.repo
正在解析主机 mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 222.186.183.149, 60.188.68.132, 60.188.68.223, ...
正在连接 mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|222.186.183.149|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1792 (1.8K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

/etc/yum.repos.d/CentOS-B 100%[====================================>]   1.75K  --.-KB/s  用时 0s     

2024-01-16 15:29:41 (184 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [1792/1792])

[root@localhost yum.repos.d]# yum makecache
Repository extras is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
Qcloud centos OS - aarch64                                             8.3 kB/s | 3.9 kB     00:00   
Qcloud centos extras - aarch64                                         4.9 kB/s | 1.5 kB     00:00   
CentOS Linux 8 - AppStream                                             4.8  B/s |  38  B     00:07   
错误:为 repo 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@localhost yum.repos.d]# yum makecache
Repository extras is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
Qcloud centos OS - aarch64                                                                   12 kB/s | 3.9 kB     00:00   
Qcloud centos extras - aarch64                                                              4.9 kB/s | 1.5 kB     00:00   
CentOS Linux 8 - AppStream                                                                   83  B/s |  38  B     00:00   
错误:为 repo 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@localhost yum.repos.d]#
写回答

1回答

JianquanLi

2024-01-17

因为没有看到你的文件内容,我也无法确定具体的原因。

看错误提示,应该是CentOS Linux 8 - AppStream这个的原因

文件夹下是否有除了CentOS-Base.repo之外的文件,如果有的话,可以先将其他的文件拷贝到其他目录下。

将其他文件移出/etc/yum.repos.d/目录之后,再执行yum makecache之后再试一下

0
0

Linux系统 从入门到进阶-全新版

软硬件全栈覆盖,真正驾驭Linux系统

477 学习 · 39 问题

查看课程