当前位置: 代码迷 >> 综合 >> centos 8 yum报错 no URLs in mirrorlist [closed]
  详细解决方案

centos 8 yum报错 no URLs in mirrorlist [closed]

热度:76   发布时间:2023-11-28 00:44:07.0

centos 8 yum命令报错

[vagrant@192.168.38.4] ~  >> sudo yum update
CentOS Linux 8 - AppStream                       71  B/s |  38  B     00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

参考https://www.centos.org/centos-linux-eol/

已经不维护了,所以换地址,执行如下命令,替换下yum.repos.d下的repo文件中的url地址域名

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

sudo yum update下就可了
参考
https://stackoverflow.com/questions/70926799/centos-through-vm-no-urls-in-mirrorlist

  相关解决方案