CentOS8的yum功能报错处理

【CentOS8遇到错误】Error: Failed to download metadata for repo ‘powertools‘...

centOS8 yum报错:“Error: Failed to download metadata for repo ‘AppStream’: Cannot pre”解决

CentOS Linux 8 已于 2021 年 12 月 31 日结束生命周期 (EOL)。这意味着 CentOS 8 将不再从 CentOS 官方项目获得开发资源。


解决

首先建立一个备份文件夹

makedir /tmp/yum

然后备份文件

cd /etc/yum.repos.d
mv *.repo /tmp/yum

然后安装阿里源

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

然后清除yum缓存再重新生成yum缓存

yum clean all
yum makecache

如果报如下类似错误

    Timeout was reached for
    http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml
    [Connection timed out after 30000 milliseconds] Could not resolve
    host: mirrors.cloud.aliyuncs.com

则执行如下命令

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

    1

参考阿里源链接:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11QTXSya



  • 评论列表:

添加回复:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。