Failed to download metadata for repo 'epel'

简介: Failed to download metadata for repo 'epel'

Status code: 404 for http://archives.fedoraproject.org/pub/archive/epel/8/Everything/x86_64/repodata/repomd.xml (IP: 38.145.60.24)
Error: Failed to download metadata for repo 'epel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

sudo yum update

使用命令更新提示404:

  • image.png

原因:第三方的镜像站中均已移除CentOS 8的源,Centos 8版本已停止更新相应依赖导致的,下载新的yum源即可搞定。解决方法如下:
备份之前的repo文件,命令:

mv /etc/yum.repos.d /etc/yum.repos.d.bak

3、创建源文件目录,命令:

mkdir -p /etc/yum.repos.d

4、下载新的yum源,分别执行以下2条命令:

curl https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo > /etc/yum.repos.d/Centos-vault-8.5.2111.repo

curl https://mirrors.aliyun.com/repo/epel-archive-8.repo > /etc/yum.repos.d/epel-archive-8.repo

image.png
就可以安装成功了。

解决办法
自2022年1月31日起,CentOS团队从官方镜像中移除CentOS 8的所有包,但软件包仍在官方镜像上保留一段时间。现在被转移到https://vault.centos.org。如需继续运行旧CentOS 8,可以在/etc/yum.repos中更新repos.d,使用vault.centos.org代替mirror.centos.org

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

目录
相关文章
|
网络协议 网络虚拟化
CentOS8下yum源配置及nmcli命令简单介绍
CentOS8下yum源配置及nmcli命令简单介绍
3749 0
CentOS8下yum源配置及nmcli命令简单介绍
|
Linux
centos 8 换阿里源
centos 8 换阿里源
6267 0
|
缓存 Linux
更新yum源的保姆级教程(有手就行)
更新yum源的保姆级教程(有手就行)
Centos8安装yum源时候出现的异常问题及解决方案(保好使)
Centos8安装yum源时候出现的异常问题及解决方案(保好使)
centos8 Failed to download metadata for repo ‘base‘: Cannot download repomd.xml
centos8 Failed to download metadata for repo ‘base‘: Cannot download repomd.xml
1781 1
|
Ubuntu 应用服务中间件 Linux
通过Certbot自动申请更新HTTPS网站的SSL证书
本文介绍了如何通过 Certbot 自动申请并更新 HTTPS 网站的 SSL 证书,配合 Crontab 实现自动续签,解决云服务商免费证书仅限 3 个月有效期的问题,适用于 CentOS、Debian、Ubuntu 系统,支持 Nginx 和 Apache 服务器。
3316 8
|
缓存 Linux 数据库
CentOS 8中 更新或下载时报错:为仓库 ‘appstream‘ 下载元数据失败 : Cannot prepare internal
通过以上步骤,您可以有效地解决 CentOS 8 中“为仓库 ‘appstream’ 下载元数据失败 : Cannot prepare internal”问题。关键在于检查网络连接、更新和切换仓库配置、清理缓存、重建 RPM 数据库以及在必要时临时禁用有问题的仓库。通过这些方法,可以确保系统能够正常进行软件包的更新和下载操作。
4313 20
|
运维 网络协议 调度
docker swarm 集群服务编排部署指南(docker stack)
docker swarm 集群服务编排部署指南(docker stack)
2227 0
|
Linux 测试技术 开发工具
CentOS Linux 8使用阿里源(安装jdk11、git测试)
CentOS Linux 8使用阿里源(安装jdk11、git测试)
2369 1
|
监控 网络协议 JavaScript
tcping和ping命令
【8月更文挑战第2天】`tcping` 是一款基于 TCP 协议的网络测试工具,不同于传统的 `ping` 命令使用 ICMP 协议,`tcping` 通过尝试与目标主机的特定端口建立 TCP 连接来检查网络连通性和端口状态。这使其在一些禁用了 ICMP 的网络环境中特别有用。`
2490 3
tcping和ping命令