linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

linux虚拟机上准备安装一下rz sz,执行yum命令后提示如下:

linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

[root@tony001 ~]# yum install lrzsz
CentOS Linux 8 - AppStream                                                                                      53  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

百度查询,有的说是关闭防火墙,有的说是网络问题,验证防火墙已关闭,网络可ping通百度,经查询发现其他linux虚拟机原来可以yum安装现在也不能执行yum安装了,怀疑是yum源的问题,改用阿里云镜像对yum进行配置

首先进行备份,将原有yum配置备份

tar cvf /etc/yum.repos.d.tar /etc/yum.repos.d

/etc/yum.repos.d下原有配置文件如下

linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

去阿里云镜像站 https://developer.aliyun.com/mirror/

去centos底下

linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

两条命令中选一条在虚拟机中执行

linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

执行完成后目录下会多出一个CentOS-Base.repo,将除此之外的其他文件全部删除(切记先执行开始的备份操作)

linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

之后依次执行以下两个命令

yum clean all

yum makecache

linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

再次进行yum安装测试,发现可以正常安装

linux下yum无法安装lrzsz,Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal

本文转自:https://blog.csdn.net/zwk_sys/article/details/122814307

上一篇:CentOS8提前EOL,阿里云源停止维护后的更新配置方法 2022-2-17


下一篇:【考试总结】2022-2-21