首先检查网络连接是否正常

ping www.google.com

如果无法访问,检查DNS解析是否正常

ping 8.8.8.8

如果DNS解析正常,但是还是无法访问,检查防火墙是否阻止了网络连接

systemctl status firewalld

如果防火墙开启了,可以先临时关闭试试

systemctl stop firewalld

如果以上都正常,可以尝试重新配置yum源

cd /etc/yum.repos.d/ mkdir backup mv *.repo backup/ curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo curl -o epel.repo http://mirrors.aliyun.com/repo/epel-8.repo

最后再次尝试安装

sudo yum install git scons gcc-c++ python-devel python3-devel protobuf-devel protobuf-compiler zlib-devel

CentOS-8 无法下载 Yum 软件包元数据:解决方法

原文地址: https://www.cveoy.top/t/topic/oyt5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录