输入以下命令

sudo dnf install -y curl policycoreutils openssh-server perl

报错 Cannot prepare internal mirrorlist: No URLs in mirrorlist
查了下资料:

问题:
在CentOS 8中,使用yum时出现错误,镜像列表中没有url,类似如下:
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

原因
在2022年1月31日,CentOS团队终于从官方镜像中移除CentOS 8的所有包。
CentOS 8已于2021年12月31日寿终正非,但软件包仍在官方镜像上保留了一段时间。现在他们被转移到https://vault.centos.org

解决方法
如果你仍然需要运行CentOS 8,你可以在/etc/yum.repos.d中更新一下源。使用vault.centos.org代替mirror.centos.org。

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

如图:
CentOS 8:  Cannot prepare internal mirrorlist: No URLs in mirrorlist  --解决方法

参考资料:https://blog.csdn.net/xiaocao_debug/article/details/122807870

相关文章:

  • 2021-10-19
  • 2022-02-17
  • 2021-06-23
  • 2022-12-23
  • 2021-09-26
  • 2021-08-31
  • 2021-11-12
猜你喜欢
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2021-07-05
  • 2022-01-06
  • 2021-09-13
  • 2021-04-08
相关资源
相似解决方案