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

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

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

[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源linux必学的60个命令的问linux操作系统基础知识题,改用阿里云镜像对yum进行配置

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

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

/etclinux常用命令/yum.repos.d下原centos是什么系统有配置文件如下

去阿里云镜像站 https://develcentos7重置root密码oper.a系统运维工资一般多少liyun.百度地图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

执行完linux常用命令成后目录下会多出一个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