Linux8yum安装报错 Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:

Linux8yum安装报错

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

解决办法 

配置yum源用阿里的源下载

1.进入linux的yum.repos.d中

cd /etc/yum.repos.d/

2.配置下载yum

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

3.安装wget 

yum install wget –y

4.更新阿里源

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

yum clean all

yum makecache

Linux8yum安装报错 Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:_第1张图片 

5.验证是否成功

yum install -y vim

 完成Linux8yum安装报错 Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:_第2张图片

忽略就行这个是我测试下载的哈

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

你可能感兴趣的:(报错,linux,centos,运维)