CentOS8使用putty安装MySQL时搜不到(无法下载)元数据,报Errors during downloading metadata for repository ‘epel‘:

CentOS8使用putty安装MySQL时搜不到(无法下载)元数据,

报Errors during downloading metadata for repository 'epel': - Status code: 404 for http://archives.fedoraproject.org/pub/archive/epel/8/Everything/x86_64/repodata/repomd.xml等错误,具体如下:

CentOS8使用putty安装MySQL时搜不到(无法下载)元数据,报Errors during downloading metadata for repository ‘epel‘:_第1张图片

这可能是配置yum源的问题,需要切换源

CentOS8使用putty安装MySQL时搜不到(无法下载)元数据,报Errors during downloading metadata for repository ‘epel‘:_第2张图片

正确解决流程可以参考下面链接博主的步骤:

【完美解决】【Centos8】Linux 为 repo ‘AppStream‘ 下载元数据失败、Could not resolve host: mirrors.cloud.aliyuncs.com_AspirinZjh的博客-CSDN博客

 在这里对其执行过程简单介绍:


运行以下命令备份之前的repo文件。
rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo

 


运行以下命令下载最新的repo文件
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo

 


运行以下命令替换repo文件中的链接,就是这一步出错了,官方提供的命令:

1、sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g'  /etc/yum.repos.d/Centos-vault-8.5.2111.repo &&  sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo

2、sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo

http://mirrors.cloud.aliyuncs.com需要替换为http://mirrors.aliyun.com,但是官方提供的命令没替换完,如果有执行官方提供的命令还是不行的话执行下面的命令:

sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g'  /etc/yum.repos.d/Centos-vault-8.5.2111.repo 
sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g'  /etc/yum.repos.d/epel-archive-8.repo

运行以下命令重新创建缓存
yum clean all && yum makecache

 

执行成果,yum install也可以正常使用了

 

你可能感兴趣的:(java,mysql,linux)