CentOS8宣告完成使命,yum命令报错:Failed AppStream

前几天在更新阿里云服务器的软件包时遇到问题,才想起CentOS8操作系统早就宣告完成使命,yum源地址也已经移除,使用默认配置的源进行yum安装时将会报错:

Error: Failed to download metadata for repo 'AppStream'

若用户希望继续使用CentOS8,建议将默认的yum源切换至CentOS-Vault源:

  • 阿里云yum源
    http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111
  • 阿里云epel源
    http://mirrors.cloud.aliyuncs.com/epel-archive/8/

操作步骤

0x01 备份原repo文件

rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo

0x02 下载新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

0x03 替换repo中的链接

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
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo

0x04 重建缓存

yum clean all && yum makecache

原创文章禁止转载:技术学堂 » CentOS8宣告完成使命,yum命令报错:Failed AppStream

赞 (0) 打赏

精彩评论

8+6=

感谢您的支持与鼓励

支付宝扫一扫打赏

微信扫一扫打赏